| I am afraid this is not a very good guide. I am by no means a Haskell expert, but even I can pick out a number of things which are not done very well and are not idiomatic Haskell. For example: > myMap func [x] = [func x] > myMap func (x:xs) = func x:(myMap func xs) myMap does not deal with the empty list, will throw an exception if it is called with one, and there is no reason for it. (Just replace myMap func [x] = [func x] with myMap func [] = []). Several functions that throw exceptions on empty lists (head, last) are introduced without any warning (such functions are considered bad style by many Haskellers). > -- Haskell has a very strong type system, and everything has a type signature. I believe a 'type signature' is the annotation, and no, not everything in Haskell has a type signature. Everything has a type. > -- if statements If is not a statement in Haskell, it is an expression. Same with case 'statements'. There were quite a few more, see discussion on the Haskell reddit: http://www.reddit.com/r/programming/comments/1h917l/learn_x_... Not all have been fixed. I love the idea of this, but I think these issues should be addressed before people actually use this to 'learn' Haskell. Edit: corrections |
1. myMap: fixed, good catch.
2. Using `head` and `last` being bad style: Where did you hear this?
3. The fixed the issues in the reddit thread yesterday. Here's the commit if you want to check it out: https://github.com/adambard/learnxinyminutes-docs/pull/62
Is there something specific that you think should be fixed?