12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849(* The [globalize_{bool,char,unit}] functions are written as matches plus the identity
function so that the type checker can give them the desired type, without having to do
anything special. However, [globalize_int] cannot be written this way, so we resort to
using an [external]. *)letglobalize_bool=function|(true|false)asb->b;;letglobalize_char=function|'\x00'..'\xFF'asc->c;;externalglobalize_float:float->float="caml_obj_dup"externalglobalize_int:int->int="%identity"externalglobalize_int32:int32->int32="caml_obj_dup"externalglobalize_int64:int64->int64="caml_obj_dup"externalglobalize_nativeint:nativeint->nativeint="caml_obj_dup"externalglobalize_bytes:bytes->bytes="caml_obj_dup"externalglobalize_string:string->string="caml_obj_dup"letglobalize_unit(()asu)=uexternalglobalize_array':'aarray->'aarray="caml_obj_dup"letglobalize_array_a=globalize_array'aletrecglobalize_listf=function|[]->[]|x::xs->fx::globalize_listfxs;;letglobalize_optionf=function|None->None|Somex->Some(fx);;letglobalize_resultglobalize_aglobalize_bt=matchtwith|Oka->Ok(globalize_aa)|Errorb->Error(globalize_bb);;letglobalize_ref'r=ref!rletglobalize_ref_r=globalize_ref'rexternalglobalize_lazy_t_mono:'alazy_t->'alazy_t="%identity"letglobalize_lazy_t_t=globalize_lazy_t_monot