Type safe
This commit is contained in:
@@ -5,11 +5,16 @@ type SealedStepDag<'a, 'plat> = private | SealedStepDag
|
||||
|
||||
type Step<'a> = private | Step
|
||||
|
||||
type Comp<'a> = private | Comp of (unit -> 'a)
|
||||
type Comp<'a> =
|
||||
private
|
||||
| Thunk of (unit -> 'a)
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Comp =
|
||||
let make (x : 'a) : Comp<'a> = Comp (fun () -> x)
|
||||
let make (x : 'a) : Comp<'a> = Thunk (fun () -> x)
|
||||
let force (x : 'a Comp) =
|
||||
match x with
|
||||
| Thunk x -> x ()
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module StepDag =
|
||||
|
Reference in New Issue
Block a user