The Haskell Cheatsheet
cheatsheet.codeslower.com
cheatsheet.codeslower.com
Much of these difficulties are also ameliorated with a good text editor (Emacs). With good syntax highlighting and indentation, it's easy to write syntactically valid code. It also really helps to be able to easily load and run GHCi.
Besides GHCi this is my reference shelf
- http://www.cl.cam.ac.uk/~ns441/files/thips.pdf
- http://acm.wustl.edu/functional/hs-breads.php
___________
- http://www.haskell.org/hoogle/
- http://www.haskell.org/haskellwiki/Typeclassopedia
- Prelude source and http://www.haskell.org/onlinereport/haskell2010/haskellch9.h...
_______________
- 2010, 98 reports (which are very readable, unstiff/undry docs
- use google to search stackoverflow/questions/tagged/haskell
- http://ezyang.com/haskell.html
____________
Books: Hudak's "School of Music" (tho I'm not sure how interesting it is unless you know how to read/play music), and the 3 books by Hutton, Thompson, and Bird. It has been remarked that the "gentle Intro" is actually kind of harsh, the Hutton and Thompson books really are gentle intro's:
http://www.haskell.org/tutorial/
http://haskell.cs.yale.edu/euterpea-2/haskell-school-of-musi...
http://www.amazon.com/Pearls-Functional-Algorithm-Design-Ric...
http://www.fing.edu.uy/inco/cursos/proggen/Transparencias/Po...
(on about the 17th google page for "haskell cheat"
___________________
also symbolhound works pretty well for searching stackoverflow for symbolic operator/function names, e.g. haskell <$>
Prelude GOA> let True ? x = \_ -> x ; False ? _ = \f -> f
Prelude GOA> True ? 4 $ 5
4
Prelude GOA> False ? 4 $ 5
5
Prelude GOA> False ? 4 $ True ? 3 $ 7
3
Prelude GOA> False ? 4 $ False ? 3 $ 7
7
Pretty neat, I think.If this is what GOA is, it actually sounds incredibly useful: http://www.haskell.org/haskellwiki/GHC/GHCi#GHCi_on_Acid. Looking up docs/source for modules? Enumerating typeclass instances? Yes please.
Things like the syntax of pattern-matching and datatypes I'd repeatedly Google for until I remembered, but relatively speaking it wasn't a huge time sink. The things that I did burn time on were things like getting types right inside monads, various other type-theory things, and cabal quirks.
I hope this cheatsheet helps people get started with Haskell, but my gut feeling is that the bigger hurdles will need another cheatsheet.
http://hackage.haskell.org/trac/haskell-prime/wiki/RemoveNPl... http://hackage.haskell.org/trac/haskell-prime/wiki/NoNPlusKP...
Cheatsheets should be as short as possible, avoiding long explanations. For example, comments might be described as "comments: line: -- ; block (nestable): {- -}"
data GADT a where
Constructor0 :: Field a -> Field b -> GADT (a, b)
Constructor1 :: ...
...You should probably change this to something like 「日本語版はこちら」 (Japanese version here), and not write it in the Latin alphabet.
Also, I thought the accepted transliteration was "wa", not "ha", but don't quote me on that.
That may be overstating things a little, I agree. On the other hand, a programming language that can't model ordering of events along some sort of timeline isn't useful for many practical applications, and monads have so far proven to be the most effective way of introducing those concepts into Haskell's naturally timeless environment. They're also absurdly overcomplicated for modelling simple but not trivial cases, relative to just writing the code in the order you want things to happen in an imperative language. So if the goal is to get more people to use Haskell to write useful software, I would expect a lot of emphasis on monads and related concepts.
When you write them in the order you want, you're implicitly chaining them with a primitive chain operator that's built-into the language.
In Haskell, this is exactly what "do" notation does. So in what sense is it "overcomplicated"?
Example, Python:
def func(x, y, z):
foo(x())
otherFunc(lambda : y.hello(z))
Haskell: func x y z = do
foo =<< x
otherFunc (hello y z)
The syntax is slightly more verbose for chaining actions as arguments (foo), but more concise when passing around first-class actions (hello).