12345678910111213141516171819202122openCore_kerneltype'at='a(* This [Obj.magic] is OK because we never allow user code access to [none] (except via
[unsafe_value]. We disallow [_ Uopt.t Uopt.t], so there is no chance of confusing
[none] with [some none]. And [float Uopt.t array] is similarly disallowed. *)letnone="Uopt.none"|>(Obj.magic:string->_t)letis_nonet=phys_equaltnoneletis_somet=not(is_nonet)letinvariantinvariant_at=ifis_somettheninvariant_atletsexp_of_tsexp_of_at=ifis_nonetthen[%sexpNone]else[%sexpSome(t:a)]letsomea=aletvalue_exnt=ifis_nonetthenfailwith"Uopt.value_exn"elsetletunsafe_valuet=tmoduleOptional_syntax=structmoduleOptional_syntax=structletis_none=is_noneletunsafe_value=unsafe_valueendend