@[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
Instances of this typeclass
- bifunctor.is_lawful_functor
- is_lawful_applicative.to_is_lawful_functor
- is_lawful_traversable.to_is_lawful_functor
- sum.is_lawful_functor
- functor.const.is_lawful_functor
- functor.add_const.is_lawful_functor
- functor.comp.is_lawful_functor
- filter.is_lawful_functor
- measure_theory.outer_measure.is_lawful_functor
- mv_polynomial.is_lawful_functor
- plift.is_lawful_functor
- ulift.is_lawful_functor
- pmf.is_lawful_functor
- witt_vector.is_lawful_functor
- stream.seq.is_lawful_functor
- pfunctor.obj.is_lawful_functor
- multiset.is_lawful_functor
- finset.is_lawful_functor
@[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 α), has_pure.pure g <*> x = g <$> x
- map_pure : ∀ {α β : Type ?} (g : α → β) (x : α), g <$> has_pure.pure x = has_pure.pure (g x)
- seq_pure : ∀ {α β : Type ?} (g : f (α → β)) (x : α), g <*> has_pure.pure x = (λ (g : α → β), g x) <$> g
- seq_assoc : ∀ {α β γ : Type ?} (x : f α) (g : f (α → β)) (h : f (β → γ)), h <*> (g <*> x) = function.comp <$> h <*> g <*> x
Instances of this typeclass
- is_lawful_monad.to_is_lawful_applicative
- is_comm_applicative.to_is_lawful_applicative
- functor.comp.is_lawful_applicative
- functor.const.is_lawful_applicative
- functor.add_const.is_lawful_applicative
- filter.is_lawful_applicative
- plift.is_lawful_applicative
- ulift.is_lawful_applicative
- finset.is_lawful_applicative
@[simp]
theorem
pure_id_seq
{α : Type u}
{f : Type u → Type v}
[applicative f]
[is_lawful_applicative f]
(x : f α) :
has_pure.pure id <*> x = x
@[class]
- to_is_lawful_applicative : is_lawful_applicative m
- bind_pure_comp_eq_map : (∀ {α β : Type ?} (f : α → β) (x : m α), x >>= has_pure.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 β), has_pure.pure x >>= f = f x
- bind_assoc : ∀ {α β γ : Type ?} (x : m α) (f : α → m β) (g : β → m γ), x >>= f >>= g = x >>= λ (x : α), f x >>= g
Instances of this typeclass
- is_lawful_monad_cont.to_is_lawful_monad
- id.is_lawful_monad
- state_t.is_lawful_monad
- except_t.is_lawful_monad
- reader_t.is_lawful_monad
- option_t.is_lawful_monad
- list.is_lawful_monad
- option.is_lawful_monad
- sum.is_lawful_monad
- trunc.is_lawful_monad
- set.is_lawful_monad
- part.is_lawful_monad
- ultrafilter.is_lawful_monad
- free_group.is_lawful_monad
- free_add_group.is_lawful_monad
- free_abelian_group.is_lawful_monad
- mv_polynomial.is_lawful_monad
- lazy_list.is_lawful_monad
- plift.is_lawful_monad
- ulift.is_lawful_monad
- writer_t.is_lawful_monad
- cont_t.is_lawful_monad
- slim_check.gen.is_lawful_monad
- parser.is_lawful_monad
- pmf.is_lawful_monad
- pfun.is_lawful_monad
- computation.is_lawful_monad
- stream.seq1.is_lawful_monad
- free_magma.is_lawful_monad
- free_add_magma.is_lawful_monad
- free_semigroup.is_lawful_monad
- free_add_semigroup.is_lawful_monad
- semiquot.is_lawful_monad
- erased.is_lawful_monad
- multiset.is_lawful_monad
- finset.is_lawful_monad
@[simp]
theorem
state_t.run_pure
{σ : Type u}
{m : Type u → Type v}
{α : Type u}
(st : σ)
[monad m]
(a : α) :
(has_pure.pure a).run st = has_pure.pure (a, st)
@[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 α) :
(has_monad_lift_t.monad_lift x).run st = has_monad_lift_t.monad_lift x >>= λ (a : α), has_pure.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' α) :
(monad_functor_t.monad_map f x).run st = monad_functor_t.monad_map f (x.run st)
@[simp]
theorem
state_t.run_get
{σ : Type u}
{m : Type u → Type v}
(st : σ)
[monad m] :
state_t.get.run st = has_pure.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 = has_pure.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_pure
{α ε : Type u}
{m : Type u → Type v}
[monad m]
(a : α) :
(has_pure.pure a).run = has_pure.pure (except.ok a)
@[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 α) :
@[simp]
@[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_pure
{ρ : Type u}
{m : Type u → Type v}
{α : Type u}
(r : ρ)
[monad m]
(a : α) :
(has_pure.pure a).run r = has_pure.pure a
@[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' α) :
(monad_functor_t.monad_map f x).run r = monad_functor_t.monad_map f (x.run 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_pure
{α : Type u}
{m : Type u → Type v}
[monad m]
(a : α) :
(has_pure.pure a).run = has_pure.pure (option.some a)
@[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 α) :
@[simp]
@[protected, instance]