Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

God damn Haskell

Name: Anonymous 2008-07-13 8:35


import IO

main :: IO ()
main = do
        putStr "Name: "
        n <- getLine
        putStrLn n


/prog/, why doesn't this code work? I understand laziness, so "n" won't be evaluated until it's needed in "putStrLn", but why does "n" get evaluated, then "putStr" and "putStrLn" get evaulated?

tl;dr How the hell do you prompt for information in Haskell?

Name: Anonymous 2008-07-13 9:20

fucking n00bs don't know about buffering? fail.

Name: Anonymous 2008-07-13 10:02

>>9
thats why Java is superior.

Name: Anonymous 2008-07-13 10:03

>>9
Wow, you are so cool, you said ``n00bs'' because you're superior and you said ``fail'' because we're at 4chan. I bet you have a lot of friends because of them.

Name: Anonymous 2008-07-13 10:15

>>11
Are you fucking retarded you fucking piece of shit, who the fucking flying fuck doesn't know about buffering?
Yes, I said n00bs because I'm superior. So what? I can't have friends because I'm superior to OP? Your logic is broken.

Name: Anonymous 2008-07-13 10:36

>>12
Grow up, you little shit.

Name: Anonymous 2008-07-13 10:45

>>11
YHBT

Name: Anonymous 2008-07-13 12:47

What's the matter, aren't you man enough to speak openly and not under the shroud of sage?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List