lean4-htt/Lake/Util/Task.lean

22 lines
546 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
instance : Monad Task where
map := Task.map
pure := Task.pure
bind := Task.bind
abbrev ETask ε := ExceptT ε Task
abbrev OptionTask := OptionT Task
def BaseIOTask := Task
instance : Monad BaseIOTask := inferInstanceAs <| Monad Task
abbrev EIOTask ε := ExceptT ε BaseIOTask
abbrev OptionIOTask := OptionT BaseIOTask
instance : Inhabited (OptionIOTask α) := ⟨failure⟩