On Tuesday, August 23, 2016 at 6:00:07 PM UTC+8, Ben Bacarisse wrote:
meInvent bbird <[email protected]> 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: | 797 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 179:05:11 |
| Calls: | 13,202 |
| Calls today: | 1 |
| Files: | 15,490 |
| Messages: | 6,579,412 |