Creighton Hogg <[EMAIL PROTECTED]> writes: > So I looked to see if there were any standard functions for > taking an input line and turning it into a list, and I > couldn't find any. How would one do this in Haskell? I > just want to parse the line into a list of strings, and > from there recover the numbers from the strings.
In other words, you want to split "lines" into "words" and "read" numbers from the result? Perhaps you should check the Prelude again. > That doesn't seem easy though, unelss there's something I'm > missing. Reading from and writing to the outside world must take place in the IO monad. The parsing and other manipulation can be done by functions, use e.g. "let" in the IO code to construct intermediate values. E.g., main can look like: main = do f <- readFile "table.txt" let x = my_parse_function f putStrLn x my_parse_function :: String -> String ... -k -- If I haven't seen further, it is by standing in the footprints of giants _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell