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: | 296 |
Nodes: | 16 (3 / 13) |
Uptime: | 49:28:54 |
Calls: | 6,649 |
Calls today: | 1 |
Files: | 12,200 |
Messages: | 5,330,100 |