main is defined to be the entry point of a Haskell program (similar to the main function in C), and must have an IO type, usually IO (). and must have an IO type
Huh?
i am a JAVA. i ahev a long doc and i make programs w/ my API. if you dont repost this comment on 10 other pages i will hax your anus tonight and make a mess of your computer and ass
Oh, I remember now: you can end main in sequence [...] instead of sequence_ [...]. It saves you from having to type the extra "_" (I'm sure there are better examples of usefulness).
Name:
Anonymous2008-06-17 20:07
>>25 sequence_ IS FASTER THAN sequence SINCE IT CAN IGNORE THE RETURN VALUES YOU DUMB SHIT. GOD PEOPLE LIKE YOU MAKE SPJ CRY AT NIGHT.
Name:
Anonymous2008-06-17 20:13
hyryst?
\
ಊ
Name:
Anonymous2008-06-17 20:14
>>22
When the whole program fails and returns a non-0 value.
Haskell's burden is to serve as an example of clean side effect programming, much like how Europe's burden is to show the Americans how to live their lives.
Name:
Anonymous2008-06-20 16:04
Every time I want to get into Haskell, I just can't get past the chapter about monads. I've tried three tutorials already and I'm nowhere as close to understanding monads.
>>31
A Monad is like a piece of code waiting to be executed. getLine, for example, returns a value of type IO String, which is a piece of code that when executed will produce a string. You can only get the value out of a monad when you execute that monad. For most monads you do that by passing them as arguments to a monad executing function (like runIdentity for Identity monad). In the case of the IO monad, however, you can only execute them by embedding them (directly or indirectly) into the monad returned by main. Hope this helps.
Name:
Anonymous2008-06-20 16:39
SO do you create a monad that, when executed, returns a number, with return 42
?
Also, is sequence an executing function like runIdentity
?