@[class]
- map_const_eq : (∀ {α β : Type ?}, functor.map_const = functor.map ∘ function.const β) . "control_laws_tac"
- id_map : ∀ {α : Type ?} (x : f α), id <$> x = x
- comp_map : ∀ {α β γ : Type ?} (g : α → β) (h : β → γ) (x : f α), (h ∘ g) <$> x = h <$> g <$> x
@[class]
- to_is_lawful_functor : is_lawful_functor f
- seq_left_eq : (∀ {α β : Type ?} (a : f α) (b : f β), a <* b = function.const β <$> a <*> b) . "control_laws_tac"
- seq_right_eq : (∀ {α β : Type ?} (a : f α) (b : f β), a *> b = function.const α id <$> a <*> b) . "control_laws_tac"
- pure_seq_eq_map : ∀ {α β : Type ?} (g : α → β) (x : f α), pure g <*> x = g <$> x
- map_pure : ∀ {α β : Type ?} (g : α → β) (x : α), g <$> pure x = pure (g x)
- seq_pure : ∀ {α β : Type ?} (g : f (α → β)) (x : α), g <*> pure x = (λ (g : α → β), g x) <$> g
- seq_assoc : ∀ {α β γ : Type ?} (x : f α) (g : f (α → β)) (h : f (β → γ)), h <*> (g <*> x) = function.comp <$> h <*> g <*> x
@[simp]
theorem
pure_id_seq
{α : Type u}
{f : Type u → Type v}
[applicative f]
[is_lawful_applicative f]
(x : f α) :
@[class]
- to_is_lawful_applicative : is_lawful_applicative m
- bind_pure_comp_eq_map : (∀ {α β : Type ?} (f : α → β) (x : m α), x >>= pure ∘ f = f <$> x) . "control_laws_tac"
- bind_map_eq_seq : (∀ {α β : Type ?} (f : m (α → β)) (x : m α), (f >>= λ (_x : α → β), _x <$> x) = f <*> x) . "control_laws_tac"
- pure_bind : ∀ {α β : Type ?} (x : α) (f : α → m β), pure x >>= f = f x
- bind_assoc : ∀ {α β γ : Type ?} (x : m α) (f : α → m β) (g : β → m γ), x >>= f >>= g = x >>= λ (x : α), f x >>= g
@[simp]
theorem
state_t.run_monad_lift
{σ : Type u}
{m : Type u → Type v}
{α : Type u}
(st : σ)
[monad m]
{n : Type u → Type u_1}
[has_monad_lift_t n m]
(x : n α) :
(monad_lift x).run st = monad_lift x >>= λ (a : α), pure (a, st)
@[simp]
theorem
state_t.run_monad_map
{σ : Type u}
{m : Type u → Type v}
{α : Type u}
(x : state_t σ m α)
(st : σ)
[monad m]
{m' : Type u → Type v}
{n n' : Type u → Type u_1}
[monad m']
[monad_functor_t n n' m m']
(f : Π {α : Type u}, n α → n' α) :
@[simp]
theorem
state_t.run_adapt
{σ : Type u}
{m : Type u → Type v}
{α : Type u}
[monad m]
{σ' σ'' : Type u}
(st : σ)
(split : σ → σ' × σ'')
(join : σ' → σ'' → σ)
(x : state_t σ' m α) :
@[simp]
theorem
state_t.run_get
{σ : Type u}
{m : Type u → Type v}
(st : σ)
[monad m] :
state_t.get.run st = pure (st, st)
@[simp]
theorem
state_t.run_put
{σ : Type u}
{m : Type u → Type v}
(st : σ)
[monad m]
(st' : σ) :
(state_t.put st').run st = pure (punit.star, st')
@[protected, instance]
def
state_t.is_lawful_monad
(m : Type u → Type v)
[monad m]
[is_lawful_monad m]
(σ : Type u) :
is_lawful_monad (state_t σ m)
@[simp]
theorem
except_t.run_map
{α β ε : Type u}
{m : Type u → Type v}
(x : except_t ε m α)
[monad m]
(f : α → β)
[is_lawful_monad m] :
@[simp]
theorem
except_t.run_monad_lift
{α ε : Type u}
{m : Type u → Type v}
[monad m]
{n : Type u → Type u_1}
[has_monad_lift_t n m]
(x : n α) :
(monad_lift x).run = except.ok <$> monad_lift x
@[protected, instance]
def
except_t.is_lawful_monad
(m : Type u → Type v)
[monad m]
[is_lawful_monad m]
(ε : Type u) :
is_lawful_monad (except_t ε m)
@[simp]
theorem
reader_t.run_map
{ρ : Type u}
{m : Type u → Type v}
{α β : Type u}
(x : reader_t ρ m α)
(r : ρ)
[monad m]
(f : α → β)
[is_lawful_monad m] :
@[simp]
theorem
reader_t.run_monad_lift
{ρ : Type u}
{m : Type u → Type v}
{α : Type u}
(r : ρ)
[monad m]
{n : Type u → Type u_1}
[has_monad_lift_t n m]
(x : n α) :
(monad_lift x).run r = monad_lift x
@[simp]
theorem
reader_t.run_monad_map
{ρ : Type u}
{m : Type u → Type v}
{α : Type u}
(x : reader_t ρ m α)
(r : ρ)
[monad m]
{m' : Type u → Type v}
{n n' : Type u → Type u_1}
[monad m']
[monad_functor_t n n' m m']
(f : Π {α : Type u}, n α → n' α) :
@[simp]
theorem
reader_t.run_read
{ρ : Type u}
{m : Type u → Type v}
(r : ρ)
[monad m] :
reader_t.read.run r = pure r
@[protected, instance]
def
reader_t.is_lawful_monad
(ρ : Type u)
(m : Type u → Type v)
[monad m]
[is_lawful_monad m] :
is_lawful_monad (reader_t ρ m)
@[simp]
theorem
option_t.run_map
{α β : Type u}
{m : Type u → Type v}
(x : option_t m α)
[monad m]
(f : α → β)
[is_lawful_monad m] :
@[simp]
theorem
option_t.run_monad_lift
{α : Type u}
{m : Type u → Type v}
[monad m]
{n : Type u → Type u_1}
[has_monad_lift_t n m]
(x : n α) :
(monad_lift x).run = some <$> monad_lift x
@[protected, instance]