Hacker News new | ask | show | jobs
by insulanian 3400 days ago
For starters this is enough and less confusing IMHO:

    open System.IO

    for line in File.ReadLines("/path/to/file") do
        printfn "%s" line
2 comments

Or using awesome |> pipeline operator

    "/path/to/file"
    |> File.ReadLines
    |> Seq.iter (printfn "%s")

the printfn can be expanded as function, instead of partial app

    "/path/to/file"
    |> File.ReadLines
    |> Seq.iter (fun line -> printfn "%s" line)
If you could make about 50 more of these snippets...I'd be using F# everyday :)
Haha, I almost forgot about this. Thanks!