Created
May 25, 2010 06:45
-
-
Save willf/412857 to your computer and use it in GitHub Desktop.
read a sequence of lines in F# #fsharp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.IO | |
let readLines (sr:TextReader) = | |
Seq.initInfinite (fun _ -> sr.ReadLine()) | |
|> Seq.takeWhile (fun x -> x <> null) | |
let consoleLines() = | |
readLines Console.In |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment