#define ATS_DYNLOADFLAG 0 staload "lib/SATS/valid.sats" assume valid(a:t@ype,b:bool) = (a,bool b) implement{a} create_valid(value : a) = (value,true) // Create unvalid value by casting null pointer to type. implement{a} create_unvalid() = let staload UN = "prelude/SATS/unsafe.sats" in ($UN.ptr0_get(the_null_ptr),false) //UNSAFE: end implement{a} unwrap_valid(v) = v.0