Equations
Equations
Basics #
@[inline]
Equations
- self.run = EStateM.map (fun (x : Except Lake.ExitCode α) => match x with | Except.ok a => 0 | Except.error rc => rc) self.toBaseIO
Instances For
Exits #
@[inline]
Exit with given return code.
Equations
- Lake.MainM.exit rc = Lake.MainM.mk (throw rc)
Instances For
Equations
- Lake.MainM.instMonadExit = { exit := fun {α : Type} => Lake.MainM.exit }
@[inline]
Try this and catch exits.
Equations
- Lake.MainM.tryCatchExit f self = EStateM.tryCatch self.toEIO f
Instances For
@[inline]
Try this and catch error codes (i.e., non-zero exits).
Equations
- Lake.MainM.tryCatchError f self = Lake.MainM.tryCatchExit (fun (rc : Lake.ExitCode) => if rc = 0 then Lake.exit 0 else f rc) self
Instances For
@[inline]
Exit with a generic error code (i.e., 1).
Equations
Instances For
@[inline]
If this exits with an error code (i.e., not 0), perform other.
Equations
Instances For
Logging and IO #
Equations
@[inline]
Print out a error line with the given message and then exit with an error code.
Equations
- Lake.MainM.error msg rc = do Lake.logError msg Lake.exit rc
Instances For
Equations
- Lake.MainM.instMonadError = { error := fun {α : Type} (msg : String) => Lake.MainM.error msg }
Equations
- Lake.MainM.instMonadLiftIO = { monadLift := fun {α : Type} => Lake.MonadError.runIO }
@[inline]
def
Lake.MainM.runLogIO
{α : Type}
(x : LogIO α)
(minLv : LogLevel := LogLevel.info)
(ansiMode : AnsiMode := AnsiMode.auto)
(out : OutStream := OutStream.stderr)
:
MainM α
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance 100]
Equations
- Lake.MainM.instMonadLiftLogIO = { monadLift := fun {α : Type} (x : Lake.LogIO α) => Lake.MainM.runLogIO x }
@[inline]
def
Lake.MainM.runLoggerIO
{α : Type}
(x : LoggerIO α)
(minLv : LogLevel := LogLevel.info)
(ansiMode : AnsiMode := AnsiMode.auto)
(out : OutStream := OutStream.stderr)
:
MainM α
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance 100]
Equations
- Lake.MainM.instMonadLiftLoggerIO = { monadLift := fun {α : Type} (x : Lake.LoggerIO α) => Lake.MainM.runLoggerIO x }