Skip to content

Instantly share code, notes, and snippets.

@lasandell
Created July 10, 2015 17:22
Show Gist options
  • Save lasandell/d42116257156e21552bd to your computer and use it in GitHub Desktop.
Save lasandell/d42116257156e21552bd to your computer and use it in GitHub Desktop.
open System
type Disposable() =
do printfn "Constrcuted!"
interface IDisposable with
member x.Dispose() = printfn "Disposed!"
let sequence =
seq {
use disposable = new Disposable()
yield! [1; 2; 3]
}
sequence |> Seq.iter (printfn "%d")
sequence |> Seq.iter (printfn "%d")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment