Skip to content

Instantly share code, notes, and snippets.

@glchapman
glchapman / Imperative.fs
Created November 29, 2023 17:44
Inlining imperative computation
module Imperative
open System
[<Struct>]
type BlockResult<'T> = NoValue | Return of 'T | Continue | Break with
member this.Close() =
match this with
| NoValue -> ValueNone
| Return x -> ValueSome x