Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file or_error.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138open!Importtype'at=('a,Error.t)Result.t[@@deriving_inlinecompare,equal,hash,sexp]letcompare:'a.('a->'a->int)->'at->'at->int=fun_cmp__a->funa__001_->funb__002_->Result.compare_cmp__aError.comparea__001_b__002_letequal:'a.('a->'a->bool)->'at->'at->bool=fun_cmp__a->funa__007_->funb__008_->Result.equal_cmp__aError.equala__007_b__008_lethash_fold_t:'a.(Ppx_hash_lib.Std.Hash.state->'a->Ppx_hash_lib.Std.Hash.state)->Ppx_hash_lib.Std.Hash.state->'at->Ppx_hash_lib.Std.Hash.state=fun_hash_fold_a->funhsv->funarg->Result.hash_fold_t_hash_fold_aError.hash_fold_thsvarglett_of_sexp:'a.(Ppx_sexp_conv_lib.Sexp.t->'a)->Ppx_sexp_conv_lib.Sexp.t->'at=let_tp_loc="src/or_error.ml.t"infun_of_a->funt->Result.t_of_sexp_of_aError.t_of_sexptletsexp_of_t:'a.('a->Ppx_sexp_conv_lib.Sexp.t)->'at->Ppx_sexp_conv_lib.Sexp.t=fun_of_a->funv->Result.sexp_of_t_of_aError.sexp_of_tv[@@@end]letinvariantinvariant_at=matchtwith|Oka->invariant_aa|Errorerror->Error.invarianterror;;include(Result:Monad.S2withtype('a,'b)t:=('a,'b)Result.twithmoduleLet_syntax:=Result.Let_syntax)includeApplicative.Make(structtypenonrec'at='atletreturn=returnletapplyfx=Result.combinefx~ok:(funfx->fx)~err:(fune1e2->Error.of_list[e1;e2]);;letmap=`Custommapend)moduleLet_syntax=structletreturn=returnincludeMonad_infixmoduleLet_syntax=structletreturn=returnletmap=mapletbind=bindletboth=both(* from Applicative.Make *)moduleOpen_on_rhs=structendendendletok=Result.okletis_ok=Result.is_okletis_error=Result.is_errorletignore=ignore_mlettry_with?(backtrace=false)f=tryOk(f())with|exn->Error(Error.of_exnexn?backtrace:(ifbacktracethenSome`GetelseNone));;lettry_with_join?backtracef=join(try_with?backtracef)letok_exn=function|Okx->x|Errorerr->Error.raiseerr;;letof_exn?backtraceexn=Error(Error.of_exn?backtraceexn)letof_exn_result?backtrace=function|Ok_asz->z|Errorexn->of_exn?backtraceexn;;leterror?strictmessageasexp_of_a=Error(Error.create?strictmessageasexp_of_a)leterror_ssexp=Error(Error.create_ssexp)leterror_stringmessage=Error(Error.of_stringmessage)leterrorfformat=Printf.ksprintferror_stringformatlettagt~tag=Result.map_errort~f:(Error.tag~tag)lettag_st~tag=Result.map_errort~f:(Error.tag_s~tag)lettag_argtmessageasexp_of_a=Result.map_errort~f:(fune->Error.tag_argemessageasexp_of_a);;letunimplementeds=error"unimplemented"ssexp_of_stringletcombine_errorsl=Result.map_error(Result.combine_errorsl)~f:Error.of_listletcombine_errors_unitl=Result.map(combine_errorsl)~f:(fun(_:unitlist)->())letfilter_ok_at_least_onel=letok,errs=List.partition_mapl~f:Result.ok_fstinmatchokwith|[]->Error(Error.of_listerrs)|_->Okok;;letfind_okl=matchList.find_mapl~f:Result.okwith|Somex->Okx|None->Error(Error.of_list(List.mapl~f:(function|Ok_->assertfalse|Errorerr->err)));;letfind_map_okl~f=With_return.with_return(fun{return}->Error(Error.of_list(List.mapl~f:(funelt->matchfeltwith|Ok_asx->returnx|Errorerr->err))));;letmap=Result.mapletiter=Result.iterletiter_error=Result.iter_error