lean4-htt/Lake/Util/Exit.lean
2022-06-03 12:57:06 -04:00

17 lines
437 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-
Copyright (c) 2021 Mac Malone. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mac Malone
-/
namespace Lake
/-- A process exit / return code. -/
abbrev ExitCode := UInt32
class MonadExit (m : Type u → Type v) where
exit {α : Type u} : ExitCode → m α
export MonadExit (exit)
instance [MonadLift m n] [MonadExit m] : MonadExit n where
exit rc := liftM (m := m) <| exit rc