|
|
|
|
|
by nandemo
5346 days ago
|
|
Well, Haskell functions are curried, so you could think of the arity as always being 1. ;-) If you're writing code, you can always use redundant parentheses at first. Then you refactor, gradually removing the parentheses or replacing them with an appropriate combination of ($) and (.). Another useful thing to learn is how to write point-free code. An example: strToUpper xs = map toUpper xs
strToUpper' = map toUpper
These are essentially the same function, but the latter is often preferred. Note also that they have the same type, namely String -> String.If you're reading code and you find it hard to parse, you probably need to read easier code (for instance, from LYAH or RWH), but more likely you need to write more code of your own. |
|
http://www.scs.stanford.edu/11au-cs240h/notes/
https://github.com/bos/stanford-cs240h
Somewhere in here are notes from Washington U of St. Louis studnets that were really helpful:
http://www.haskell.org/haskellwiki/Tutorials
http://haskell.org/haskellwiki/Category:Tutorials
http://haskell.org/haskellwiki/Learning_Haskell