Idris2Doc : Control.RIO

Control.RIO

(source)

Definitions

dataRIO : Type->Type->Type
  A stack-safe, effectful computation
producing a value of type `a`, with
the possibility of an error of type `x`.

We get flexible error handling by using an open union
over a list of types for `x` (see `Control.RIO.App`),
and we get flexible, mockable effects by providing the
corresponding implementations (typically mere records)
via the envirionment.

About the name: This stems originally from Haskell, where
`RIO` is an abbreviation for `ReaderT IO`. In Idris, we need
to add exceptions to the stack, which will not be handled
automatically in `IO` itself. On the other hand, we can just
use implicit arguments for our effects, so there is no
need for an envirionment in the monad itself.

Totality: total
Visibility: public export
Constructors:
Lift : PrimIO (Eitherxa) ->RIOxa
Chain : RIOx1a-> (Eitherx1a->RIOx2b) ->RIOx2b

Hints:
Applicative (RIOx)
BifunctorRIO
Functor (RIOx)
HasIO (RIOx)
Monad (RIOx)
eval : RIOxa->IO (Eitherxa)
  Tail-recursively evaluate a `RIO` computation.

Totality: total
Visibility: export
run : Uninhabitedx=>RIOxa->IOa
  Tail-recursively evaluate a `RIO` computation,
which cannot fail with an exception.

Totality: total
Visibility: export
liftEither : Eitherxa->RIOxa
  Wrap an `Either x a` in a `RIO` computation.

Totality: total
Visibility: export
liftEitherIO : IO (Eitherxa) ->RIOxa
  Wrap an `IO (Either x a)` in a `RIO` computation.

Totality: total
Visibility: export
mapApp : (Eitherxa->Eitheryb) ->RIOxa->RIOyb
  Map a function over the result over a `RIO` computation.

Totality: total
Visibility: export
fail : x->RIOxa
  Fail with an error.

Totality: total
Visibility: export
catch : (x->RIOya) ->RIOxa->RIOya
  Catch an exception with the given handler.

Totality: total
Visibility: export
finally : RIOx () ->RIOxa->RIOxa
  Makes sure the given (cleanup) action is run at the end
of a computation even in case of an error.

Totality: total
Visibility: export
lift : Uninhabitedx=>RIOxa->RIOya
Totality: total
Visibility: export