[Haskell-cafe] Tutorial on Haskell

ajb at spamcop.net ajb at spamcop.net
Tue Apr 17 03:40:03 EDT 2007


G'day all.

I wrote:

> I think you could.  What you need to convince a strict programmer of is
> that laziness gives you modularity.  The Graham Hutton Sudoku solver is
> a nice example, but it'd be cool if we had a similar example that was
> less cheesy than Sudoku.

OK, it's not pretty, but this is diff(1) in 120 lines:

    http://andrew.bromage.org/darcs/diff/

It illustrates:

    - Lazy evaluation (dynamic programming, lazy I/O, infinite lists)
    - Function pipelining with (.) and ($)
    - Monads
    - Immutable arrays
    - List comprehensions
    - Algebraic data types
    - Type-safe type synonyms (newtype)
    - Fancy newtype deriving (Num)
    - Smart constructors
    - Pattern matching with at-patterns
    - Lambda expressions
    - Operator sections
    - More besides

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list