type obj = Obj.t
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
sharing=true, it checks sharing and cycles. Generally it makes
tag_check VERY slow.
tag_check hangs with cyclic data.
Limitations and Todos:
- The input
Obj.tvalue must be created by proper funcitons such as
- Things are not really tail-recursive. It may stack-overflow for deep data.
- Closures (functions, objects, lazy thunks) are not supported.
- The target types are limited to what Typerep can handle: for example, numbers of tuple components and variant arguments are limited upto 5.