module NonNegativeInt =
type T = private | NonNegativeInt of int
let mutable saved:int = 0
let create i =
if (i >= 0 )
then
saved <- i
Some (NonNegativeInt i)
else None
let get =
2
open NonNegativeInt
module Test =
let show (input:T option) =
match input with
| Some i ->
printfn "%i" ( 10*NonNegativeInt.get)
open Test
show (NonNegativeInt.create -42)