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: | 715 |
| Nodes: | 16 (3 / 13) |
| Uptime: | 143:05:30 |
| Calls: | 12,089 |
| Calls today: | 2 |
| Files: | 14,998 |
| Messages: | 6,517,457 |