Personal tools

Example code

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Corrected broken links and solved warnings given by http://validator.w3.org/checklink ; added a link to "A tour of the Haskell Monad functions")
(Links shouldn't be called "here".)
Line 2: Line 2:
 
examples from various popular [[Libraries_and_tools|Haskell projects]].
 
examples from various popular [[Libraries_and_tools|Haskell projects]].
 
To start learning the language, good places to start are
 
To start learning the language, good places to start are
[[Learning_Haskell|here]], [[Haskell_in_5_steps|here]] and
+
[[Learning_Haskell|Learning Haskell]],
[[Books_and_tutorials|here]].
+
[[Haskell_in_5_steps|Haskell in 5 steps]],
  +
[[Books]], and [[Tutorials]].
   
 
More code may be found [http://haskell.org/haskellwiki/Category:Code on the wiki].
 
More code may be found [http://haskell.org/haskellwiki/Category:Code on the wiki].

Revision as of 05:12, 9 December 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 Learning Haskell, Haskell in 5 steps, Books, and Tutorials.

More code may be found on the wiki.


1 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):

2 Application code

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

3 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).
A tour of the Haskell Monad functions 
Small usage examples of the basic Haskell monad functions