3 ms·
If you’re willing to take input on stdin, you can rewrite it without >>=: main = interact number where number = lines . zipWith addNumber [0.
by bradrn 5y ago
If you’re willing to take input on stdin, you can rewrite it without >>=:
main = interact number
where
number = lines . zipWith addNumber [0..] . unlines
addNumber n l = show n ++ " " ++ l
My point is that the logic itself does not require the idea of monadic sequencing — it’s relevant only for the minimal amount of surrounding IO.