The areas / V33. Data structures and computation
Mathlib.Control.Bitraversable.Instances
23 declarations. Mathlib docs · Source
Bitraversable instances
This file provides Bitraversable instances for concrete bifunctors:
ProdSumFunctor.ConstflipFunction.bicomplFunction.bicompr
References
Tags
traversable bitraversable functor bifunctor applicative
theorem Sum.bitraverse.match_1.congr_eq_2 E1 #
∀ {α : Type u_1} {β : Type u_2} (motive : α ⊕ β → Sort u_3) (x : α ⊕ β) (h_1 : (x : α) → motive (Sum.inl x))
(h_2 : (x : β) → motive (Sum.inr x)) (x_1 : β),
x = Sum.inr x_1 →
(match x with
| Sum.inl x => h_1 x
| Sum.inr x => h_2 x) ≍
h_2 x_1
theorem Prod.bitraverse.match_1.congr_eq_1 E1 #
∀ {α : Type u_1} {β : Type u_2} (motive : α × β → Sort u_3) (x : α × β) (h_1 : (x : α) → (y : β) → motive (x, y))
(x_1 : α) (y : β),
x = (x_1, y) →
(match x with
| (x, y) => h_1 x y) ≍
h_1 x_1 y
theorem Sum.bitraverse.match_1.congr_eq_1 E1 #
∀ {α : Type u_1} {β : Type u_2} (motive : α ⊕ β → Sort u_3) (x : α ⊕ β) (h_1 : (x : α) → motive (Sum.inl x))
(h_2 : (x : β) → motive (Sum.inr x)) (x_1 : α),
x = Sum.inl x_1 →
(match x with
| Sum.inl x => h_1 x
| Sum.inr x => h_2 x) ≍
h_1 x_1
def Prod.bitraverse E1 #
{F : Type u → Type u} →
[Applicative F] →
{α : Type u_1} → {α' : Type u} → {β : Type u_2} → {β' : Type u} → (α → F α') → (β → F β') → α × β → F (α' × β')
The bitraverse function for α × β.
instance instBitraversableProd E0 #
Bitraversable Prod
instance instLawfulBitraversableProd E0 #
LawfulBitraversable Prod
def Sum.bitraverse E1 #
{F : Type u → Type u} →
[Applicative F] →
{α : Type u_1} → {α' : Type u} → {β : Type u_2} → {β' : Type u} → (α → F α') → (β → F β') → α ⊕ β → F (α' ⊕ β')
The bitraverse function for α ⊕ β.
instance instBitraversableSum E0 #
Bitraversable Sum
instance instLawfulBitraversableSum E0 #
LawfulBitraversable Sum
def Const.bitraverse E1 #
{F : Type u → Type u} →
[Applicative F] →
{α : Type u_1} →
{α' : Type u} →
{β : Type u_2} → {β' : Type u} → (α → F α') → (β → F β') → Functor.Const α β → F (Functor.Const α' β')
The bitraverse function for Const. It throws away the second map.
instance Bitraversable.const E0 #
Bitraversable Functor.Const
instance LawfulBitraversable.const E0 #
LawfulBitraversable Functor.Const
def flip.bitraverse E1 #
{t : Type u → Type u → Type u} →
[Bitraversable t] →
{F : Type u → Type u} →
[Applicative F] → {α α' β β' : Type u} → (α → F α') → (β → F β') → flip t α β → F (flip t α' β')
The bitraverse function for flip.
instance Bitraversable.flip E0 #
{t : Type u → Type u → Type u} → [Bitraversable t] → Bitraversable (flip t)
instance LawfulBitraversable.flip E0 #
∀ {t : Type u → Type u → Type u} [inst : Bitraversable t] [LawfulBitraversable t], LawfulBitraversable (flip t)
instance Bitraversable.traversable E0 #
{t : Type u → Type u → Type u} → [Bitraversable t] → {α : Type u} → Traversable (t α)
instance Bitraversable.isLawfulTraversable E0 #
∀ {t : Type u → Type u → Type u} [inst : Bitraversable t] [LawfulBitraversable t] {α : Type u}, LawfulTraversable (t α)
def Bicompl.bitraverse E1 #
{t : Type u → Type u → Type u} →
[Bitraversable t] →
(F G : Type u → Type u) →
[Traversable F] →
[Traversable G] →
{m : Type u → Type u} →
[Applicative m] →
{α β α' β' : Type u} →
(α → m β) → (α' → m β') → Function.bicompl t F G α α' → m (Function.bicompl t F G β β')
The bitraverse function for bicompl.
instance instBitraversableBicompl E0 #
{t : Type u → Type u → Type u} →
[Bitraversable t] →
(F G : Type u → Type u) → [Traversable F] → [Traversable G] → Bitraversable (Function.bicompl t F G)
instance instLawfulBitraversableBicomplOfLawfulTraversable E0 #
∀ {t : Type u → Type u → Type u} [inst : Bitraversable t] (F G : Type u → Type u) [inst_1 : Traversable F]
[inst_2 : Traversable G] [LawfulTraversable F] [LawfulTraversable G] [LawfulBitraversable t],
LawfulBitraversable (Function.bicompl t F G)
def Bicompr.bitraverse E1 #
{t : Type u → Type u → Type u} →
[Bitraversable t] →
(F : Type u → Type u) →
[Traversable F] →
{m : Type u → Type u} →
[Applicative m] →
{α β α' β' : Type u} → (α → m β) → (α' → m β') → Function.bicompr F t α α' → m (Function.bicompr F t β β')
The bitraverse function for bicompr.
instance instBitraversableBicompr E0 #
{t : Type u → Type u → Type u} →
[Bitraversable t] → (F : Type u → Type u) → [Traversable F] → Bitraversable (Function.bicompr F t)
instance instLawfulBitraversableBicomprOfLawfulTraversable E0 #
∀ {t : Type u → Type u → Type u} [inst : Bitraversable t] (F : Type u → Type u) [inst_1 : Traversable F]
[LawfulTraversable F] [LawfulBitraversable t], LawfulBitraversable (Function.bicompr F t)