Personal tools

Talk:How to read Haskell

From HaskellWiki

Jump to: navigation, search

1 Help us help you!

Does Haskell hurt your brain? Post here any questions or observations you have about reading Haskell. What are the things that make Haskell painful for you to read? Is it just the density of things? Comments welcome -- EricKow 16:22, 13 August 2006 (UTC)

2 What confuses non-Haskellers

Since this tutorial is not yet written, we encourage you to note here the things which confuse non-Haskellers about the code code.

  • layout instead of semicolons?
  • super-super-concise stuff (things using liftM and liftM2)
  • the difference between
    x <- foo
    x = foo

3 Scratch pad

You have thirty seconds. Can you understand what .+ does?

(-1) .+ _ = -1
_ .+ (-1) = -1
a .+ b = a + b
I was initially going to use this example for saying that you should get used to pattern matching... but now I'm not so sure. It shows you two things really, (1) the pattern matching stuff, and (2) the fact that we like to define our operators in this infixy way.