
21 Jul
2008
21 Jul
'08
3:14 p.m.
On Mon, 21 Jul 2008 06:51:27 +0200, Felipe Lessa
On Sun, Jul 20, 2008 at 10:30 PM, Rafael Gustavo da Cunha Pereira Pinto
wrote: convert :: String -> [Int] convert = map read . words
read :: FilePath -> IO [[Int]] read fp = (map convert . lines) `fmap` readFile fp
If a single list of Ints is OK, the code can be much simpler:
read' :: FilePath -> IO [Int] read' fp = (map read . words) `fmap` readFile fp
-- Met vriendelijke groet, Henk-Jan van Tuyl -- http://functor.bamikanarie.com http://Van.Tuyl.eu/ --