-- First line of input goes last, last line goes first module Main where import qualified Data.Text as T import qualified Data.Text.IO as TextIO (interact) {- (.) :: (a->b) -> (c->a) -> c -> b ; function composition reverse :: [a] -> [a] ; reverse list back to front T.lines :: T.Text->[T.Text] ; breaks text into lines at newlines T.unlines :: [T.Text] -> T.Text ; join text list with line terminators TextIO.interact :: (T.Text -> T.Text) -> IO (); the input and the output is text -} main :: IO() main = TextIO.interact (T.unlines . reverse . T.lines) -- ------------For GNU Emacs ------------ -- Local Variables: -- compile-command: "ghc -Wall main2T.hs" -- End: