123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146open!ImportmoduleBinable=Binable0(* All the types as exposed in the mli are defined in this [Types] module. The rest of
this file is simply overriding all the bin_io, compare, and sexp functions to raise
exceptions. *)moduleTypes=structmoduleNobody=structtypet[@@derivingbin_io,compare,hash,sexp]letname="Nobody"endmoduleMe=structtypet[@@derivingbin_io,compare,hash,sexp]letname="Me"endmoduleRead=structtypet=[`Read][@@derivingbin_io,compare,hash,sexp]letname="Read"endmoduleWrite=structtypet=[`Who_can_writeofMe.t][@@derivingbin_io,compare,hash,sexp]letname="Write"endmoduleImmutable=structtypet=[Read.t|`Who_can_writeofNobody.t][@@derivingbin_io,compare,hash,sexp]letname="Immutable"endmoduleRead_write=structtypet=[Read.t|Write.t][@@derivingbin_io,compare,hash,sexp]letname="Read_write"endmoduleUpper_bound=structtype'at=[Read.t|`Who_can_writeof'a][@@derivingbin_io,compare,hash,sexp]letname="Upper_bound"endendletfailwithf=Printf.failwithf(* This is an explicit module type instead of just given inline as the return signature of
[Only_used_as_phantom_type1] to avoid an unused value warning with bin_io values. *)moduletypeSexpable_binable_comparable=sigtype'at='a[@@derivingbin_io,compare,hash,sexp,sexp_grammar]end(* Override all bin_io, sexp, compare functions to raise exceptions *)moduleOnly_used_as_phantom_type1(Name:sigvalname:stringend):Sexpable_binable_comparable=structtype'at='aletsexp_of_t__=failwithf"Unexpectedly called [%s.sexp_of_t]"Name.name()lett_of_sexp__=failwithf"Unexpectedly called [%s.t_of_sexp]"Name.name()letcompare___=failwithf"Unexpectedly called [%s.compare]"Name.name()lethash_fold_t___=failwithf"Unexpectedly called [%s.hash_fold_t]"Name.name()lett_sexp_grammar_=Sexplib.Sexp_grammar.coerceBase.Nothing.t_sexp_grammarincludeBinable.Of_binable1_without_uuid[@alert"-legacy"](structtype'at='a[@@derivingbin_io]end)(structtypenonrec'at='atletto_binable_=failwithf"Unexpectedly used %s bin_io serialization"Name.name();;letof_binable_=failwithf"Unexpectedly used %s bin_io deserialization"Name.name();;end)endmoduleOnly_used_as_phantom_type0(T:sigtypet[@@derivingbin_io,compare,hash,sexp]valname:stringend):sigtypet=T.t[@@derivingbin_io,compare,hash,sexp_poly]end=structmoduleM=Only_used_as_phantom_type1(T)typet=T.tM.t[@@derivingbin_io,compare,hash,sexp]let__t_of_sexp__=t_of_sexpendmoduleStable=structmoduleV1=structmoduleNobody=Only_used_as_phantom_type0(Types.Nobody)moduleMe=Only_used_as_phantom_type0(Types.Me)moduleRead=Only_used_as_phantom_type0(Types.Read)moduleWrite=Only_used_as_phantom_type0(Types.Write)moduleRead_write=Only_used_as_phantom_type0(Types.Read_write)moduleImmutable=Only_used_as_phantom_type0(Types.Immutable)typenobody=Nobody.t[@@derivingbin_io,compare,hash,sexp]typeme=Me.t[@@derivingbin_io,compare,hash,sexp]moduleUpper_bound=structmoduleM=Only_used_as_phantom_type1(Types.Upper_bound)type'at='aTypes.Upper_bound.tM.t[@@derivingbin_io,compare,hash,sexp]let__t_of_sexp__=t_of_sexpendendmoduleExport=structtyperead=V1.Read.t[@@derivingbin_io,compare,hash,sexp]typewrite=V1.Write.t[@@derivingcompare,hash,sexp]typeimmutable=V1.Immutable.t[@@derivingbin_io,compare,hash,sexp]typeread_write=V1.Read_write.t[@@derivingbin_io,compare,hash,sexp]type'aperms='aV1.Upper_bound.t[@@derivingbin_io,compare,hash,sexp]endendincludeStable.V1moduleExport=Stable.Export