mathlib3 documentation

control.monad.cont

structure monad_cont.label (α : Type w) (m : Type u Type v) (β : Type u) :
Type (max v w)
  • apply : α m β
Instances for monad_cont.label
  • monad_cont.label.has_sizeof_inst
def monad_cont.goto {α : Type u_1} {β : Type u} {m : Type u Type v} (f : monad_cont.label α m β) (x : α) :
m β
Equations
@[class]
structure monad_cont (m : Type u Type v) :
Type (max (u+1) v)
Instances of this typeclass
Instances of other typeclasses for monad_cont
  • monad_cont.has_sizeof_inst
@[class]
structure is_lawful_monad_cont (m : Type u Type v) [monad m] [monad_cont m] :
Instances of this typeclass
Instances of other typeclasses for is_lawful_monad_cont
  • is_lawful_monad_cont.has_sizeof_inst
@[reducible]
def cont (r : Type u) (α : Type w) :
Type (max w u)
Equations
def cont_t.run {r : Type u} {m : Type u Type v} {α : Type w} :
cont_t r m α m r) m r
Equations
def cont_t.map {r : Type u} {m : Type u Type v} {α : Type w} (f : m r m r) (x : cont_t r m α) :
cont_t r m α
Equations
theorem cont_t.run_cont_t_map_cont_t {r : Type u} {m : Type u Type v} {α : Type w} (f : m r m r) (x : cont_t r m α) :
(cont_t.map f x).run = f x.run
def cont_t.with_cont_t {r : Type u} {m : Type u Type v} {α β : Type w} (f : m r) α m r) (x : cont_t r m α) :
cont_t r m β
Equations
theorem cont_t.run_with_cont_t {r : Type u} {m : Type u Type v} {α β : Type w} (f : m r) α m r) (x : cont_t r m α) :
@[protected, ext]
theorem cont_t.ext {r : Type u} {m : Type u Type v} {α : Type w} {x y : cont_t r m α} (h : (f : α m r), x.run f = y.run f) :
x = y
@[protected, instance]
def cont_t.monad {r : Type u} {m : Type u Type v} :
Equations
@[protected, instance]
def cont_t.is_lawful_monad {r : Type u} {m : Type u Type v} :
def cont_t.monad_lift {r : Type u} {m : Type u Type v} [monad m] {α : Type u} :
m α cont_t r m α
Equations
@[protected, instance]
def cont_t.has_monad_lift {r : Type u} {m : Type u Type v} [monad m] :
Equations
theorem cont_t.monad_lift_bind {r : Type u} {m : Type u Type v} [monad m] [is_lawful_monad m] {α β : Type u} (x : m α) (f : α m β) :
@[protected, instance]
def cont_t.monad_cont {r : Type u} {m : Type u Type v} :
Equations
@[protected, instance]
def cont_t.monad_except {r : Type u} {m : Type u Type v} (ε : out_param (Type u_1)) [monad_except ε m] :
Equations
@[protected, instance]
def cont_t.monad_run {r : Type u} {m : Type u Type v} :
monad_run (λ (α : Type u), m r) ulift (m r)) (cont_t r m)
Equations
def except_t.mk_label {m : Type u Type v} [monad m] {α β ε : Type u} :
Equations
theorem except_t.goto_mk_label {m : Type u Type v} [monad m] {α β ε : Type u} (x : monad_cont.label (except ε α) m β) (i : α) :
def except_t.call_cc {m : Type u Type v} [monad m] {ε : Type u} [monad_cont m] {α β : Type u} (f : monad_cont.label α (except_t ε m) β except_t ε m α) :
except_t ε m α
Equations
@[protected, instance]
def except_t.monad_cont {m : Type u Type v} [monad m] {ε : Type u} [monad_cont m] :
Equations
def option_t.mk_label {m : Type u Type v} [monad m] {α β : Type u} :
Equations
def option_t.call_cc {m : Type u Type v} [monad m] [monad_cont m] {α β : Type u} (f : monad_cont.label α (option_t m) β option_t m α) :
Equations
@[protected, instance]
Equations
def writer_t.mk_label {m : Type u Type v} [monad m] {α : Type u_1} {β ω : Type u} [has_one ω] :
monad_cont.label × ω) m β monad_cont.label α (writer_t ω m) β
Equations
theorem writer_t.goto_mk_label {m : Type u Type v} [monad m] {α : Type u_1} {β ω : Type u} [has_one ω] (x : monad_cont.label × ω) m β) (i : α) :
def writer_t.call_cc {m : Type u Type v} [monad m] [monad_cont m] {α β ω : Type u} [has_one ω] (f : monad_cont.label α (writer_t ω m) β writer_t ω m α) :
writer_t ω m α
Equations
@[protected, instance]
def writer_t.monad_cont {m : Type u Type v} [monad m] (ω : Type u) [monad m] [has_one ω] [monad_cont m] :
Equations
def state_t.mk_label {m : Type u Type v} [monad m] {α β σ : Type u} :
monad_cont.label × σ) m × σ) monad_cont.label α (state_t σ m) β
Equations
theorem state_t.goto_mk_label {m : Type u Type v} [monad m] {α β σ : Type u} (x : monad_cont.label × σ) m × σ)) (i : α) :
monad_cont.goto (state_t.mk_label x) i = λ (s : σ), monad_cont.goto x (i, s)
def state_t.call_cc {m : Type u Type v} [monad m] {σ : Type u} [monad_cont m] {α β : Type u} (f : monad_cont.label α (state_t σ m) β state_t σ m α) :
state_t σ m α
Equations
@[protected, instance]
def state_t.monad_cont {m : Type u Type v} [monad m] {σ : Type u} [monad_cont m] :
Equations
def reader_t.mk_label {m : Type u Type v} [monad m] {α : Type u_1} {β : Type u} (ρ : Type u) :
Equations
theorem reader_t.goto_mk_label {m : Type u Type v} [monad m] {α : Type u_1} {ρ β : Type u} (x : monad_cont.label α m β) (i : α) :
def reader_t.call_cc {m : Type u Type v} [monad m] {ε : Type u} [monad_cont m] {α β : Type u} (f : monad_cont.label α (reader_t ε m) β reader_t ε m α) :
reader_t ε m α
Equations
@[protected, instance]
def reader_t.monad_cont {m : Type u Type v} [monad m] {ρ : Type u} [monad_cont m] :
Equations
def cont_t.equiv {m₁ : Type u₀ Type v₀} {m₂ : Type u₁ Type v₁} {α₁ r₁ : Type u₀} {α₂ r₂ : Type u₁} (F : m₁ r₁ m₂ r₂) (G : α₁ α₂) :
cont_t r₁ m₁ α₁ cont_t r₂ m₂ α₂

reduce the equivalence between two continuation passing monads to the equivalence between their underlying monad

Equations