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: | 766 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 08:59:22 |
| Calls: | 12,762 |
| Calls today: | 6 |
| Files: | 15,362 |
| Messages: | 6,557,060 |