Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type obj = Obj.t
val typerep_of_obj : obj Typerep_lib.Std.Typerep.t
val typename_of_obj : obj Typerep_lib.Std.Typename.t
exception Ill_typed of Typerep_lib.Std.Typerep.packed * Obj.t * string
exception Not_supported of Typerep_lib.Std.Typerep.packed * Obj.t * string
val tag_check : sharing:bool -> 'a Typerep_lib.Std.Typerep.t -> Obj.t -> unit
tag_check ~sharing (tyrep : t Typerep.t) o
checks whether o
is safely used as a value of t
. If the check fails it raises Ill_typed
. If it finds non supported data such as closures, it raises Not_supported
.
If sharing=true
, it checks sharing and cycles. Generally it makes tag_check
VERY slow.
If sharing=false
, tag_check
hangs with cyclic data.
Limitations and Todos:
Obj.t
value must be created by proper funcitons such as Obj.repr
, output_value
and Marshal.to_channel
, etc..val obj : sharing:bool -> 'a Typerep_lib.Std.Typerep.t -> Obj.t -> 'a
Type safe version of Obj.obj
using tag_check
. The same limitations of tag_check
apply.