If this is a typical file reader, you should start with lines . This can allow you to completely avoid Data.String.Utils.rstrip :
> lines "one time\na moose\nbit my sister\n" ["one time", "a moose", "bit my sister"]
As you can see, lines takes the text of the entire file and correctly turns each line into a line without a finite new line. This means that you can write a program like this:
main = mapM_ (putStrLn . process) . lines =<< readFile "foo.txt" where process :: String -> String process = -- your code here --
Nathan shively-sanders
source share