• + 2 comments

    That's still ugly, IMO. Here's my runner:

    readInt x = read x :: Int
    main = putStr . unlines . run . (map readInt) . words =<< getContents
    

    From run, you can just work with pure functions like the Haskell gods intended.