instance
Lake.instMonadErrorOfMonadLift
{m : Type u_1 → Type u_2}
{n : Type u_1 → Type u_3}
[MonadLift m n]
[Lake.MonadError m]
:
Equations
- Lake.instMonadErrorOfMonadLift = { error := fun {α : Type ?u.33} (msg : String) => liftM (Lake.error msg) }
Equations
- Lake.instMonadErrorIO = { error := fun {α : Type} (msg : String) => throw (IO.userError msg) }
Equations
- Lake.instMonadErrorEIOString = { error := fun {α : Type} (msg : String) => throw msg }
Equations
- Lake.instMonadErrorExceptString = { error := fun {α : Type ?u.7} (msg : String) => throw msg }
@[inline]
def
Lake.MonadError.runEIO
{m : Type → Type u_1}
{ε α : Type}
[Monad m]
[Lake.MonadError m]
[MonadLiftT BaseIO m]
[ToString ε]
(x : EIO ε α)
:
m α
Perform an EIO action.
If it throws an error, invoke error
with its string representation.
Equations
- Lake.MonadError.runEIO x = do let __do_lift ← liftM x.toBaseIO match __do_lift with | Except.ok a => pure a | Except.error e => Lake.error (toString e)
Instances For
@[inline]
def
Lake.MonadError.runIO
{m : Type → Type u_1}
{α : Type}
[Monad m]
[Lake.MonadError m]
[MonadLiftT BaseIO m]
(x : IO α)
:
m α
Perform an IO action.
If it throws an error, invoke error
with its string representation.