Difference between revisions of "Talk:How to read Haskell"

From HaskellWiki
Jump to navigation Jump to search
 
(from the content page)
 
Line 2: Line 2:
   
 
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 -- [[User:EricKow|EricKow]] 16:22, 13 August 2006 (UTC)
 
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 -- [[User:EricKow|EricKow]] 16:22, 13 August 2006 (UTC)
  +
  +
  +
== 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 <haskell>x <- foo</haskell> and <haskell>x = foo</haskell>
  +
  +
== Scratch pad ==
  +
  +
You have thirty seconds. Can you understand what <code>.+</code> does?
  +
<haskell>
  +
(-1) .+ _ = -1
  +
_ .+ (-1) = -1
  +
a .+ b = a + b
  +
</haskell>
  +
: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.

Latest revision as of 04:17, 20 August 2006

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)


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
    
    and
    x = foo
    

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.