3 ms·
To add to what rtpg says, if you look at an actual, monadic example of an IO: putStrLn "What is your name?" >> getLine >>= \name -> putStrLn ("Hi, "
by BillMryes 12y ago
To add to what rtpg says, if you look at an actual, monadic example of an IO:
putStrLn "What is your name?"
>> getLine >>=
\name -> putStrLn ("Hi, " ++ name ++ "!")
It's just a giant chain of instructions, each previous result feeding into the next. Nowhere do we assign anything, modify anything, etc. No mutation.