12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061moduleArray=ArrayLabelsmoduleList=ListLabelsmoduleString=StringLabelstypet=|Atomofstring|Listoftlist(* XXX otherwise the dependency isn't recorded by bootstrap *)moduleSexp_intf=Sexp_intfmoduleEncoder=structtypesexp=ttype'at='a->sexpletunit()=List[]letstrings=Atomsletinti=Atom(string_of_inti)letfloatf=Atom(string_of_floatf)letboolb=Atom(string_of_boolb)letpairfafb(a,b)=List[faa;fbb]lettriplefafbfc(a,b,c)=List[faa;fbb;fcc]letlistfl=List(List.mapl~f)letarrayfa=listf(Array.to_lista)letoptionf=function|None->List[]|Somex->List[fx]letrecordl=List(List.mapl~f:(fun(n,v)->List[Atomn;v]))letunknown_=Atom"<unknown>"letconstrname=function|[]->Atomname|args->List(Atomname::args)endletrecto_string=function|Atoms->Escape.quote_if_neededs|Listl->Printf.sprintf"(%s)"(List.map~f:to_stringl|>String.concat~sep:" ")letrecppppf=function|Atoms->Format.pp_print_stringppf(Escape.quote_if_neededs)|List[]->Format.pp_print_stringppf"()"|List(first::rest)->Format.pp_open_boxppf1;Format.pp_print_stringppf"(";Format.pp_open_hvboxppf0;ppppffirst;List.iterrest~f:(funsexp->Format.pp_print_spaceppf();ppppfsexp);Format.pp_close_boxppf();Format.pp_print_stringppf")";Format.pp_close_boxppf()