On Tuesday, August 23, 2016 at 6:00:07 PM UTC+8, Ben Bacarisse wrote:
meInvent bbird <jobmattcon@gmail.com> writes:
parse error on input `\'
import System.IO
import Control.Monad
main = do
file <- readFile "hello.txt"
forM_ [5..7] (lines file) \i ->
putStrLn i
Did you mean
forM_ (lines file) (\i -> putStrLn i)
? The syntax error is that you need ()s round the lambda expression
here, but the extra list [5..7] is puzzling me.
would like to choose specified lines to display
parse error on input `\'
import System.IO
import Control.Monad
main = do
file <- readFile "hello.txt"
forM_ [5..7] (lines file) \i ->
putStrLn i
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 113 |
Nodes: | 8 (1 / 7) |
Uptime: | 123:57:48 |
Calls: | 2,501 |
Files: | 8,692 |
Messages: | 1,924,232 |