Idris2Doc : Control.Monad.MErr

Control.Monad.MErr

(source)

Reexports

importpublic Data.List.Quantifiers.Extra

Definitions

0Result : ListType->Type->Type
  Generalized result of running a pure computation with
error handling: Possible error values are wrapped in
a heterogeneous sum.

Totality: total
Visibility: public export
interfaceMErr : (ListType->Type->Type) ->Type
  A monad with error handling via a generalized bind

Possible errors are given as a `List Type` parameter, and a single
error is wrapped in an `HSum`.

Parameters: m
Methods:
fail : HSumes->mesa
succeed : a->mesa
attempt : mesa->mfs (Resultesa)
bind : mesa-> (a->mesb) ->mesb
mapImpl : (a->b) ->mesa->mesb
appImpl : mes (a->b) ->mesa->mesb

Implementation: 
MCancelf->MErrf
fail : MErrm=>HSumes->mesa
Totality: total
Visibility: public export
succeed : MErrm=>a->mesa
Totality: total
Visibility: public export
attempt : MErrm=>mesa->mfs (Resultesa)
Totality: total
Visibility: public export
bind : MErrm=>mesa-> (a->mesb) ->mesb
Totality: total
Visibility: public export
mapImpl : MErrm=> (a->b) ->mesa->mesb
Totality: total
Visibility: public export
appImpl : MErrm=>mes (a->b) ->mesa->mesb
Totality: total
Visibility: public export
fromResult : MErrm=>Resultesa->mesa
Totality: total
Visibility: export
throw : MErrm=>Hasxes=>x->mesa
  Throws a single error by injecting it into the sum of possible errors.

Totality: total
Visibility: export
injectEither : MErrm=>Hasxes=>Eitherxa->mesa
  Inject an `Either e a` computation into an `Async` monad dealing
with several possible errors.

Totality: total
Visibility: export
handleErrors : MErrm=> (HSumes->mfsa) ->mesa->mfsa
  Handle possible errors with the given function

Totality: total
Visibility: export
catch : MErrm=> (0e : Type) ->Hasees=>mesa->mes (Eitherea)
  Tries to extract errors of a single type from a computation that
can fail wrapping it in a `Left`. Other errors will be rethrown.

Totality: total
Visibility: export
extractErr : MErrm=> (0e : Type) -> {autop : Hasees} ->mesa->m (es-e) (Eitherea)
  Tries to extract errors of a single type from a computation that
can fail wrapping it in a `Left`. Other errors will be rethrown.

Unlike `catch`, this will decompose the list of possible errors,
so errors can be handled one type at a time.

Totality: total
Visibility: export
mapErrors : MErrm=> (HSumes->HSumfs) ->mesa->mfsa
Totality: total
Visibility: export
widenErrors : MErrm=>All (\{arg:0}=>Elem{arg:0}es) fs=>mfsa->mesa
Totality: total
Visibility: export
weakenErrors : MErrm=>m [] a->mfsa
Totality: total
Visibility: export
dropErrs : MErrm=>mes () ->m [] ()
Totality: total
Visibility: export
liftError : MErrm=>m [e] a->mfs (Eitherea)
Totality: total
Visibility: export
handle : MErrm=>All (\e=>e->m [] a) es->mesa->m [] a
Totality: total
Visibility: export
bindResult : MErrm=>mesa-> (Resultesa->mfsb) ->mfsb
  Sequencing of computations plus error handling

Totality: total
Visibility: export
onError : MErrm=>mesa-> (HSumes->m [] ()) ->mesa
  Runs the given handler in case of an error but does not
catch the error in question.

Totality: total
Visibility: export
ifError : MErrm=>Hasees=>Eqe=>e-> Lazy a->mesa->mesa
  Handles the given error by replacing it with the provided value.

All other errors will be unaffected.

Totality: total
Visibility: export