School of Expression example code
This page contains the accompanying software to the School of Expression textbook by
Paul Hudak. Here's the complete list of the code in the order of
chapters:
- Problem Solving, Programming, and Calculation
- A Module of Shapes: Part I
- Simple Graphics (Snowflake)
- Shapes II: Drawing Shapes
- Polymorphic and Higher-Order Functions
- Shapes III: Perimeters of Shapes
- Trees
- A Module of Regions
- More About Higher-Order Functions
- Drawing Regions
- Proof by Induction
- Qualified Types
- A Module of Simple Animations
- Programming With Streams (Memoization)
- A Module of Reactive Animations
- Communicating With the Outside World
- Rendering Reactive Animations
- Higher-Order Types
- An Imperative Robot Language
- Functional Music Composition
- Interpreting Functional Music
- From Performance to MIDI
- A Tour of the PreludeList Module
- A Tour of Haskell's Standard Type Classes
- Appendix A. Built-in Types Are Not Special
- Appendix B. Pattern-Matching Details
Some chapters contain incomplete code fragments and are not meant to
be loaded by GHCi. These are provided as .txt files.
The remaining files are Haskell literate source code (.lhs). You
may load them using the latest version of
Haskell Platform.
Double-click should do the loading automatically on Windows machines,
otherwise you may navigate down to the directory of this document and then
open the Haskell modules from there.
Update Notice (Jan 2012):
- All code should now work with latest Haskell Platform and
GLFW package
for Haskell, which must be installed prior to running SOE.
- For MacOS X, unfortunately SOE cannot be run from under GHCi
interactively due to problems with the Graphics library it
uses. SOE programs must be compiled in order to run OS X.
This means you have to export the main function from
a particular module (by adding it to the module export list)
and compile with command line:
ghc -main-is=...
.