Last active
July 16, 2019 09:08
-
-
Save CoditCompany/ab992a252bb520ea89e1a9a45f93e0db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open FPrimitive | |
let unknown = 10 | |
let untrusted = Untrust unknown | |
type NonZeroInt = | |
private NonZeroInt of int with | |
static member create x = | |
Spec.def<int> | |
|> Spec.notEqual 0 "should not be zero" | |
|> Spec.createModel NonZeroInt x | |
let (trusted : Result<NonZeroInt, string list>) = | |
Untrust.getWithResult NonZeroInt.create untrusted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment