Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file result.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2020 Nomadic Labs <contact@nomadic-labs.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)openLwt.Infixtype('a,'e)t=('a,'e)result=Okof'a|Errorof'eletokx=Okxletok_sx=Lwt.return(Okx)leterrorx=Errorxleterror_sx=Lwt.return(Errorx)letvaluer~default=matchrwithOkv->v|Error_->defaultletvalue_fr~default=matchrwithOkv->v|Error_->default()letbindrf=matchrwithOkv->fv|Error_aserror->errorletbind_srf=matchrwithOkv->fv|Error_aserror->Lwt.returnerrorletbind_errorrf=matchrwithOk_asok->ok|Errore->feletbind_error_srf=matchrwithOk_asok->Lwt.returnok|Errore->feletjoin=function|(Error_aserror)|Ok(Error_aserror)->error|Ok(Ok_asok)->okletmapf=functionOkv->Ok(fv)|Error_aserror->errorletmap_efr=bindrfletmap_sf=function|Okv->fv>>=funv->Lwt.return(Okv)|Error_aserror->Lwt.returnerrorletmap_esfr=bind_srfletmap_errorf=functionOk_asok->ok|Errore->Error(fe)letmap_error_efr=bind_errorrfletmap_error_sf=function|Okv->Lwt.return(Okv)|Errore->fe>>=fune->Lwt.return(Errore)letmap_error_esfr=bind_error_srfletfold~ok~error=functionOkv->okv|Errore->erroreletiterf=functionOkv->fv|Error_->()letiter_sf=functionOkv->fv|Error_->Lwt.return_unitletiter_errorf=functionOk_->()|Errore->feletiter_error_sf=functionOk_->Lwt.return_unit|Errore->feletis_ok=functionOk_->true|Error_->falseletis_error=functionOk_->false|Error_->trueletequal~ok~errorxy=match(x,y)with|(Okx,Oky)->okxy|(Errorx,Errory)->errorxy|(Ok_,Error_)|(Error_,Ok_)->falseletcompare~ok~errorxy=match(x,y)with|(Okx,Oky)->okxy|(Errorx,Errory)->errorxy|(Ok_,Error_)->-1|(Error_,Ok_)->1letto_option=functionOkv->Somev|Error_->Noneletof_option~error=functionSomev->Okv|None->Errorerrorletto_list=functionOkv->[v]|Error_->[]letto_seq=function|Okv->Stdlib.Seq.returnv|Error_->Stdlib.Seq.empty