Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file process.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294leterrormsg_json=raise(Failuremsg)moduleInternal=structmoduletypeS=sigtypejsonvalnull:unit->jsonendmoduletypeInternal_strict_intf=sigtypejsonvalmember:string->[>`Assocof(string*json)list]->jsonvalindex:int->[>`Listofjsonlist]->jsonvalmap:(json->json)->[>`Listofjsonlist]->[>`Listofjsonlist]valto_assoc:[>`Assocof(string*json)list]->(string*json)listvalto_bool:[>`Boolofbool]->boolvalto_float:[>`Floatoffloat]->floatvalto_string:[>`Stringofstring]->stringvalto_string_option:[>`Stringofstring|`Null]->stringoptionvalto_option:(([>`Null]as'a)->json)->'a->jsonoptionvalto_list:[>`Listofjsonlist]->jsonlistvalto_bool_option:[>`Boolofbool|`Null]->booloptionvalto_float_option:[>`Floatoffloat|`Null]->floatoptionvalto_number:[>`Floatoffloat]->floatvalto_number_option:[>`Floatoffloat|`Null]->floatoptionvalconvert_each:(json->json)->[>`Listofjsonlist]->jsonlistvalrev_filter_map:('a->'aoption)->'alist->'alist->'alistvalfilter_map:('a->'aoption)->'alist->'alistvalrev_flatten:'alist->[>`Listof'alist]list->'alistvalflatten:[>`Listof'alist]list->'alistvalfilter_index:int->[>`Listofjsonlist]list->jsonlistvalfilter_list:[>`Listof'a]list->'alistvalfilter_assoc:[>`Assocof'a]list->'alistvalfilter_bool:[>`Boolofbool]list->boollistvalfilter_float:[>`Floatoffloat]list->floatlistvalfilter_string:[>`Stringofstring]list->stringlistvalfilter_member:string->[>`Assocof(string*json)list]list->jsonlistvalfilter_number:[>`Floatoffloat]list->floatlistvalkeys:[>`Assocof(string*'a)list]->stringlistvalvalues:[>`Assocof(string*'a)list]->'alistvalcombine:[>`Assocof'alist]->[>`Assocof'alist]->[>`Assocof'alist]valsort:([>`Assocof(string*'a)list|`Listof'alist]as'a)->'aendmoduleShared=structletrecrev_filter_mapfaccl=matchlwith|[]->acc|hd::tl->matchfhdwith|None->rev_filter_mapfacctl|Somev->rev_filter_mapf(v::acc)tlletfilter_mapfl=List.rev(rev_filter_mapf[]l)letrecrev_flattenaccl=matchlwith|[]->acc|hd::tl->matchhdwith|`Listl2->rev_flatten(List.rev_appendl2acc)tl|_->rev_flattenacctlletflattenl=List.rev(rev_flatten[]l)endmoduleStrict(M:S):Internal_strict_intfwithtypejson=M.json=structtypejson=M.jsonletassocnameobj:json=tryList.assocnameobjwithNot_found->M.null()letmembernamev:json=matchvwith|`Assocobj->assocnameobj|json->error("Expected `Assoc to find name '"^name^"' in")jsonletindexiv:json=matchvwith|`Listl->letlen=List.lengthlinleti'=ifi<0thenlen+ielseiinifi'<0||i'>=lenthenraise(Invalid_argument(string_of_inti^" out of bounds"))elseList.nthli'|json->error"Can't index none `List type "jsonletmapfv=matchvwith|`Listl->`List(List.mapfl)|json->error"Can't map over none `List type "jsonletto_assoc=function|`Assocobj->obj|json->error"Expected `Assoc"jsonletto_bool=function|`Boolb->b|json->error"Expected `Bool"jsonletto_float=function|`Floatf->f|json->error"Expected `Float"jsonletto_string=function|`Strings->s|json->error"Expected `String"jsonletto_string_option=function|`Strings->Somes|`Null->None|json->error"Expected `String or `Null"jsonletto_optionfv:jsonoption=matchvwith|`Null->None|v->Some(fv)letto_listv:jsonlist=matchvwith|`Listl->l|json->error"Expected `List"jsonletto_float_option=function|`Floatf->Somef|`Null->None|json->error"Expected `Float or `Null"jsonletto_bool_option=function|`Boolb->Someb|`Null->None|json->error"Expected `Bool or `Null"jsonletto_number=function|`Floatf->f|json->error"Expected `Float"jsonletto_number_option=function|`Floatf->Somef|`Null->None|json->error"Expected `Float or `Null"jsonletconvert_eachf=function|`Listl->List.mapfl|json->error"Expected `List"jsonletrev_filter_map=Shared.rev_filter_mapletfilter_map=Shared.filter_mapletrev_flatten=Shared.rev_flattenletflatten=Shared.flattenletfilter_indexil=filter_map(function|`Listl->(trySome(List.nthli)with_->None)|_->None)lletfilter_listl=filter_map(function`Listl->Somel|_->None)lletfilter_assocl=filter_map(function`Assocl->Somel|_->None)lletfilter_booll=filter_map(function`Boolb->Someb|_->None)lletfilter_floatl=filter_map(function`Floatf->Somef|_->None)lletfilter_stringl=filter_map(function`Strings->Somes|_->None)lletfilter_memberkl=filter_map(function`Assocl->(trySome(List.assockl)with_->None)|_->None)lletfilter_numberl=filter_map(function|`Floatf->Somef|_->None)lletkeyso=to_assoco|>List.map(fun(key,_)->key)letvalueso=to_assoco|>List.map(fun(_,value)->value)letcombinefirstsecond=match(first,second)with|(`Assoca,`Assocb)->`Assoc(a@b)|(_,_)->raise(Invalid_argument"Expected two objects")letrecsortjson=matchjsonwith|`Assoco->leto=List.rev(List.rev_map(fun(k,v)->(k,sortv))o)in`Assoc((List.stable_sort(fun(k1,_)(k2,_)->String.comparek1k2))o)|`Listl->`List(List.rev(List.rev_mapsortl))|el->elendmoduletypeInternal_basic_intf=sigvalto_number:[>`Intofint|`Floatoffloat]->floatvalto_number_option:[>`Intofint|`Floatoffloat|`Null]->floatoptionvalto_int:[>`Intofint]->intvalto_int_option:[>`Intofint|`Null]->intoptionvalfilter_int:[>`Intofint]list->intlistvalfilter_number:[>`Intofint|`Floatoffloat]list->floatlistendmoduleBasic(M:S):Internal_basic_intf=structletto_number=function|`Inti->floati|`Floatf->f|json->error"Expected `Int or `Float"jsonletto_number_option=function|`Inti->Some(floati)|`Floatf->Somef|`Null->None|json->error"Expected `Int, `Float or `Null"jsonletto_int=function|`Inti->i|json->error"Expected `Int"jsonletto_int_option=function|`Inti->Somei|`Null->None|json->error"Expected `Int or `Null"jsonletfilter_intl=Shared.filter_map(function`Inti->Somei|_->None)lletfilter_numberl=Shared.filter_map(function|`Inti->Some(floati)|`Floatf->Somef|_->None)lendmoduletypeInternal_extended_intf=sigvalsort:([>`Assocof(string*'a)list|`Listof'alist|`Tupleof'alist|`Variantof'b*'aoption]as'a)->'aendmoduleExtended(M:S):Internal_extended_intf=structletrecsortjson=matchjsonwith|`Assoco->leto=List.rev(List.rev_map(fun(k,v)->(k,sortv))o)in`Assoc((List.stable_sort(fun(k1,_)(k2,_)->String.comparek1k2))o)|`Tuplel|`Listl->`List(List.rev(List.rev_mapsortl))|`Variant(k,Somev)asv1->letv'=sortvinifv'==vthenv1else`Variant(k,Somev')|el->elendendmoduleStrict=structmoduleM=structtypejson=Json.Strict.jsonletnull()=`NullendincludeInternal.Strict(M)endmoduleBasic=structmoduleM=structtypejson=Json.Basic.jsonletnull()=`NullendincludeInternal.Strict(M)includeInternal.Basic(M)endmoduleExtended=structmoduleM=structtypejson=Json.Extended.jsonletnull()=`NullendincludeInternal.Strict(M)includeInternal.Basic(M)includeInternal.Extended(M)endmoduleYojson_safe=structmoduleM=structtypejson=[|`Null|`Boolofbool|`Intofint|`Intlitofstring|`Floatoffloat|`Stringofstring|`Assocof(string*json)list|`Listofjsonlist|`Tupleofjsonlist|`Variantof(string*jsonoption)]letnull()=`NullendincludeInternal.Strict(M)includeInternal.Basic(M)includeInternal.Extended(M)end