
On Sat, Sep 1, 2012 at 10:42 AM, Patrick Redmond
Interesting. Does that mean the lines following a "x <- getLine" are simply balled up into a function? What if there are multiple lines?
I'll insert the translation:
main = do main = fn <- getLine getLine >>= \fn -> ln <- getLine getLine >>= \ln -> putStr $ reverse ln putStr (reverse ln) >> putStr " " putStr " " >> putStr $ reverse fn putStr (reverse fn)
Which is just a single large expression. "do" syntax is not magic, nor is it some fundamentally different language. It's just a convenient way to write a certain repetitious pattern. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms