LocSta
LocSta copied to clipboard
Think about mutability
Example:
let mutFunc ctor =
(ctor ()) <|> fun cont (_: unit) -> gen {
let res = cont ()
return { value = res; state = cont }
}
let increment seed =
fun () ->
let mutable x = seed
let f () =
x <- x + 1
x
f
|> mutFunc
Gen.toSeq id (increment 3) |> Seq.toListN 10