Reading input from console in F# (as a sequence of lines)
What you have there is a value, but you probably want it to be a function:

let rec readlines () = seq {
    let line = Console.ReadLine()
    if line &lt;&gt; null then
        yield line
        yield! readlines ()
}