It's strange, but Haskell is more difficult to read than write. This is because most code on e.g. Hackage uses some very complicated gymnastics involving Applicative, Arrows, or whatever. So it's hard to learn from other people's programs.
Also, a warning: learning Haskell might screw with your ability to write code in other languages! It took me two weeks before I stopped making every line of Python a lambda.
I'm really curious to see how other people are progressing through the learning process for Haskell (and other HM-based functional languages). I rarely use lambdas, and I feel that Haskell is much easier to read than to write. Clearly there's something different about our approaches. I learned SML back in school, picked up OCaml about 3 years ago, and picking up Haskell was still a bit of a trip.
I also find I use lambdas less in Haskell than in other languages. I think it's because in Haskell, constructs like partial application, function composition or lifting are concise and natural to express, and those constructs cover most common use cases for an anonymous function. I think
map (find needle) haystacks
is clearer (as well as shorter!) than
map (\haystack -> find needle haystack) haystacks
In most other languages things like partial application are a pain to express, so a lambda is an easier way out.
(Now I'm imagining the six lines of Java I'd have to write to achieve the same effect as those four words of Haskell, and trying not to giggle. Functional style is addictive.)
Sorry - I meant that it makes me use lambdas in Python (you're right, I don't use many lambdas in Haskell either).
I find myself using them in Python everywhere as a substitute for currying and/or laziness, e.g.:
def f(a,b):
... # do stuff
def g(a,b):
... # do other stuff
meths = {'use f':f, 'use g':g}
a = calculate_a()
m = pick_a_method()
x = do_cool_thing(data,lambda b: meths['m'](a,b))
For those already proficient with programming that just wnat to pick up Haskell, it's ideal.
Then I would suggest an exercise that involves manipulating abstract syntax, for example parsing and interpreting a little language. ("Build yourself a Scheme..." might be good though I didn't read it myself.) This is where the language really shines, and you don't need any of the recently popular trickery like arrows or GADTs.
It's strange, but Haskell is more difficult to read than write. This is because most code on e.g. Hackage uses some very complicated gymnastics involving Applicative, Arrows, or whatever. So it's hard to learn from other people's programs.
Also, a warning: learning Haskell might screw with your ability to write code in other languages! It took me two weeks before I stopped making every line of Python a lambda.