newbie syntax question

John Meacham
Tue, 24 Jul 2001 12:43:39 -0700

this should be on a list of the 10 first questions someone will ask when
learning haskell. I have introduced several friends to the language and
they all seem to ask the same things, if not always in the same order..

whats the deal with Int -> Int -> Int ... (currying)
what does $ mean? is it 'special' syntax? (no, just a $ b = a b)
why can't "a <- getChar" be "a = getChar" in a do expression?
how do I convert an IO a to just an a? (unsafePerformIO, but that is the
	wrong answer to the wrong question)
general confusion about namespaces, the difference between (a,b) the
	type and (a,b) the value for instance.
how to write some basic idioms only used in an imperitive setting,
incrementing a counter, processing input, maintaining state
with variables which don't directly translate to haskell usually leading
to some confusion when you try to explain why they need to restructure
their program.

and on a more abstract level, the view of 'do' as a hack for IO rather
than monads as an independant and useful abstraction. (i find the Maybe
monad one of the better ways to introduce people to non-IO monads,
especially if they are used to Maybe in non-monadic usage.)

I have some email exchanges somewhere where I explained some of these
concepts, perhaps I will edit them and add them to the Wiki, or better
yet, find the best explanations from the list and add them... and of
course any other newbie questions other people find they encounter...

this is somewhat odd ground, because when helping someone learn the
language, I WANT people to come to these questions on their own and ask
them since it means they are thinking and noticing the places where they
need to readjust, so its maybe not a newbies FAQ, for someone evaluating
whether to learn the language, but more of a two weeks in and not quite
getting everything FAQ. 


John Meacham - California Institute of Technology, Alum. -