[Haskell-cafe] Tutorial on Haskell
Hans van Thiel
hthiel.char at zonnet.nl
Mon Apr 16 08:56:50 EDT 2007
On Mon, 2007-04-16 at 09:34 +0100, Simon Peyton-Jones wrote:
> I have agreed to give a 3-hr tutorial on Haskell at the Open Source Convention 2007
> I'm quite excited about this: it is a great opportunity to expose Haskell to a bunch of smart folk, many of whom won't know much about Haskell. My guess is that they'll be Linux/Perl/Ruby types, and they'll be practitioners rather than pointy-headed academics.
> One possibility is to do a tutorial along the lines of "here's how to reverse a list", "here's what a type is" etc; you know the kind of thing. But instead, I'd prefer to show them programs that they might consider *useful* rather than cute, and introduce the language along the way, as it were.
> So this message is to ask you for your advice. Many of you are exactly the kind of folk that come to OSCON --- except that you know Haskell. So help me out:
> Suggest concrete examples of programs that are
> * small
> * useful
> * demonstrate Haskell's power
> * preferably something that might be a bit
> tricky in another language
> For example, a possible unifying theme would be this:
> Another might be Don's cpu-scaling example
> But there must be lots of others. For example, there are lots in the blog entries that Don collects for the Haskell Weekly Newsletter. But I'd like to use you as a filter: tell me your favourites, the examples you find compelling. (It doesn't have to be *your* program... a URL to a great blog entry is just fine.) Of course I'll give credit to the author.
> Remember, the goal is _not_ "explain monads". It's "Haskell is a great way to Get The Job Done".
I'm really enthusiastic about parsec. Even though the principles are
(still) far above my head, I've been able to use it on a .csv table
produced by OO Calc (the spreadsheet). The tutorial is also very good,
and maybe parsec is also an example of (possible) interaction of Haskell
to 'modules' written in other programming languages. You can do
something (simple but useful) with parsec after just an afternoon's
fwiw, summing up my own Haskell experience:
I've been learning Haskell for a year now, and I find it very difficult.
I miss a training in computer science and often I feel like the guy in
that movie who's on a 500 mile trip driving an old lawn mower. Traffic
zooms past, and often you depend on people who're willing to lend a
hand. Having said that, it's also fun and I enjoy the pioneer spirit in
The major advantages of Haskell are, IMO,
1) the type system is a great aid to the programmer and programs are
short. Therefore Haskell is very well suited for the independent
developer who can't afford huge amounts of code. Open Source has many of
2) polymorphism is also a great advantage. You can write your program in
the most general types using e.g. only equality and order, and fine tune
them later to more specific types which perform better.
3) the difficulty of Haskell is not necessarily a bad thing, it also
makes it interesting, and there are many good libraries to use. But
Haskell is also pretty scaleable, in the sense that you can do a lot of
things just with recursion, then do them better with maps, folds, list
comprehensions, then do them better with some monadic replacements, and
4) there is a very helpful and knowledgeable community.
A major disadvantage of Haskell is the lack of books, especially with
regard to intermediate level programming and the libraries.
Documentation that is available varies in quality and is, in general,
Hans van Thiel
More information about the Haskell-Cafe