Difference between revisions of "Example code"

From HaskellWiki
Jump to navigation Jump to search
(url)
Line 4: Line 4:
 
[[Learning_Haskell|here]], [[Haskell_in_5_steps|here]] and
 
[[Learning_Haskell|here]], [[Haskell_in_5_steps|here]] and
 
[[Books_and_tutorials|here]].
 
[[Books_and_tutorials|here]].
  +
 
More code may be found [http://haskell.org/haskellwiki/Category:Code on the wiki].
  +
   
 
=== Library code ===
 
=== Library code ===
Line 49: Line 52:
 
* [http://haskell.org/haskellwiki/Darcs_repositories More code ...]
 
* [http://haskell.org/haskellwiki/Darcs_repositories More code ...]
   
  +
== Examples ==
More code may be found [http://haskell.org/haskellwiki/Category:Code on the wiki].
 
  +
  +
; [[Tying the Knot]] : An example that illustrates different ways to define recursive data structures. The example defines a simple language (illustrating how to define some recursive structures) and an interpreter for the language (illustrating how to work with the recursive structures).
  +
   
 
[[Category:Code]]
 
[[Category:Code]]

Revision as of 21:29, 10 January 2007

To get a feel for what real world Haskell looks like, here are some examples from various popular Haskell projects. To start learning the language, good places to start are here, here and here.

More code may be found on the wiki.


Library code

Library code usually differs from application code: it is often highly structured, and documented with haddock, and can be rather optimised. Some instructive examples (syntax highlighting by hscolour):

Application code

Code from popular Haskell applications. Such code often makes use of a monadic IO, and sometimes other advanced features such as concurrency:

Examples

Tying the Knot
An example that illustrates different ways to define recursive data structures. The example defines a simple language (illustrating how to define some recursive structures) and an interpreter for the language (illustrating how to work with the recursive structures).