This is the homepage for CS 254: Introduction to Functional Programming, a course offered by Fritz Ruehr at the Computer Science Department of Willamette University.
This course provides a broad introduction to programming in the functional style, including motivations, history, programming techniques and theory. Functional programming provides concise and elegant solutions to many problems, using an approach based on mathematics, logic and proof. The course will be taught in Haskell, a powerful, modern programming language which can be used for both mathematical investigations and serious system development. Topics covered will include a broad introduction to computing, symbolic representation of data, list manipulation, recursion, algebraic data types, higher-order functions and type systems. The study of functional programming languages provides a useful foundation and perspective for further study of topics in algebra, logic, programming languages, computer science theory and linguistics.
For (much) more sophsitication, see Conal Elliot's paper on his Pan system.
Cards.hs for our
fun card-shuffling experiments from the Thursday before break!
gen function to pick out a list of
people from a family tree, all those of the "nth generation". See
the file for Rose trees from lecture.
PS: I added some helpful hints to the latest lab!
tinsert function
from lecture (the file is here).
insert (which is in the file),
but now we want to insert an item into a tree, specifically a binary search tree,
so that the item goes appropriately left or right depending on whether it is smaller
or larger than the value in the node of the tree we are inserting into.
lfold (related to the Haskell Prelude's foldl)
to generalize the definition of rev1 (related to the Prelude's reverse):
rev1 xs = reva xs []
where reva [] ys = ys
reva (x:xs) ys = reva xs (x:ys)
lfold f u xs = lfolda xs u
where lfolda [] ys = ...
lfolda (x:xs) ys = ...
(Hint: I have used the variable ys here, but note that this ys is not necessarily
a list!)
We will be using the Haskell programming language as our main implementation vehicle. There are plenty of links there about the language, how to use it and some implementations (check out the wiki in particular for programming advice).
ord and chr)
Properties.Start In: box to set the default directory.
In the lab, we use H:\ to default to the home drive
(you have to have the drive mapped for this to work).
Students setting this up on their own computers can select whatever directory they want to use.File:Options:WinHugs, change the font size to 11 (or whatever you find legible);File:Options:WinHugs, change the default editor option to: (note that there are spaces between the 2 words in the folder names and there is a space after the"C:\Program Files\Crimson Editor\cedt.exe /L:%d %s "
(just the stuff between the quotes, not the quotes themselves)
%s!)Path
to include the path to the WinHugs folder.Tools:Preferences:General: select "use spaces in place of tabs";Tools:Preferences:Files: Deselect "load recent..."
(although students may want to leave this on their own computers);C:\Program Files]Crimson Editor\spec folder:
haskell.spcandhaskell.key
Here are a few fun, interesting or otherwise difficult to categorize links that came up in lecture at various points.