4 ms·
For starters this is enough and less confusing IMHO: open System.IO for line in File.ReadLines("/path/to/file") do printfn "%s" line
by insulanian 10y 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
- enricosada 10y agoOr 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)
- throwaway7645 10y agoIf you could make about 50 more of these snippets...I'd be using F# everyday :)
- jackmott 10y agoboom http://fssnip.net/ http://fssnip.net/
- throwaway7645 10y agoHaha, I almost forgot about this. Thanks!