2 ms·
runeks mentioned print “Enter name:” print (“Hello “ ++ readStdinLine ++ “!”) which can't be written like that with do notation. It's also pretty con
by tome 7y ago
runeks mentioned
print “Enter name:”
print (“Hello “ ++ readStdinLine ++ “!”)
which can't be written like that with do notation. It's also pretty confusing code to write in any language, so maybe that's not a problem.
- nightski 7y agoTrue, do notation does require you to add a line - main = do print "Enter name:" name <- getLine print ("Hello " ++ name ++ "!") But I only said that it makes this convenient not that it allowed you to write any statement you want. It still makes it easy to intersperse pure and non-pure code.