Bitraversable instances #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file provides bitraversable
instances for concrete bifunctors:
References #
Tags #
traversable bitraversable functor bifunctor applicative
@[protected, instance]
Equations
@[protected, instance]
Equations
- prod.is_lawful_bitraversable = {to_is_lawful_bifunctor := prod.is_lawful_bifunctor, id_bitraverse := prod.is_lawful_bitraversable._proof_1, comp_bitraverse := prod.is_lawful_bitraversable._proof_2, bitraverse_eq_bimap_id := prod.is_lawful_bitraversable._proof_3, binaturality := prod.is_lawful_bitraversable._proof_4}
@[protected, instance]
Equations
@[protected, instance]
Equations
- sum.is_lawful_bitraversable = {to_is_lawful_bifunctor := sum.is_lawful_bifunctor, id_bitraverse := sum.is_lawful_bitraversable._proof_1, comp_bitraverse := sum.is_lawful_bitraversable._proof_2, bitraverse_eq_bimap_id := sum.is_lawful_bitraversable._proof_3, binaturality := sum.is_lawful_bitraversable._proof_4}
@[nolint]
def
const.bitraverse
{F : Type u → Type u}
[applicative F]
{α : Type u_1}
{α' : Type u}
{β : Type u_2}
{β' : Type u}
(f : α → F α')
(f' : β → F β') :
functor.const α β → F (functor.const α' β')
The bitraverse function for const
. It throws away the second map.
Equations
- const.bitraverse f f' = f
@[protected, instance]
Equations
@[protected, instance]
Equations
- is_lawful_bitraversable.const = {to_is_lawful_bifunctor := is_lawful_bifunctor.const, id_bitraverse := is_lawful_bitraversable.const._proof_1, comp_bitraverse := is_lawful_bitraversable.const._proof_2, bitraverse_eq_bimap_id := is_lawful_bitraversable.const._proof_3, binaturality := is_lawful_bitraversable.const._proof_4}
def
flip.bitraverse
{t : Type u → Type u → Type u}
[bitraversable t]
{F : Type u → Type u}
[applicative F]
{α α' β β' : Type u}
(f : α → F α')
(f' : β → F β') :
The bitraverse function for flip
.
Equations
- flip.bitraverse f f' = bitraversable.bitraverse f' f
@[protected, instance]
Equations
@[protected, instance]
def
is_lawful_bitraversable.flip
{t : Type u → Type u → Type u}
[bitraversable t]
[is_lawful_bitraversable t] :
Equations
@[protected, instance]
def
bitraversable.traversable
{t : Type u → Type u → Type u}
[bitraversable t]
{α : Type u} :
traversable (t α)
Equations
@[protected, instance]
def
bitraversable.is_lawful_traversable
{t : Type u → Type u → Type u}
[bitraversable t]
[is_lawful_bitraversable t]
{α : Type u} :
is_lawful_traversable (t α)
Equations
- bitraversable.is_lawful_traversable = {to_is_lawful_functor := _, id_traverse := _, comp_traverse := _, traverse_eq_map_id := _, naturality := _}
def
bicompl.bitraverse
{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}
(f : α → m β)
(f' : α' → m β') :
function.bicompl t F G α α' → m (function.bicompl t F G β β')
The bitraverse function for bicompl
.
Equations
- bicompl.bitraverse F G f f' = bitraversable.bitraverse (traversable.traverse f) (traversable.traverse f')
@[protected, instance]
def
function.bicompl.bitraversable
{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)
Equations
- function.bicompl.bitraversable F G = {to_bifunctor := function.bicompl.bifunctor F G traversable.to_functor, bitraverse := bicompl.bitraverse F G _inst_3}
@[protected, instance]
def
function.bicompl.is_lawful_bitraversable
{t : Type u → Type u → Type u}
[bitraversable t]
(F G : Type u → Type u)
[traversable F]
[traversable G]
[is_lawful_traversable F]
[is_lawful_traversable G]
[is_lawful_bitraversable t] :
Equations
def
bicompr.bitraverse
{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}
(f : α → m β)
(f' : α' → m β') :
function.bicompr F t α α' → m (function.bicompr F t β β')
The bitraverse function for bicompr
.
Equations
- bicompr.bitraverse F f f' = traversable.traverse (bitraversable.bitraverse f f')
@[protected, instance]
def
function.bicompr.bitraversable
{t : Type u → Type u → Type u}
[bitraversable t]
(F : Type u → Type u)
[traversable F] :
Equations
@[protected, instance]
def
function.bicompr.is_lawful_bitraversable
{t : Type u → Type u → Type u}
[bitraversable t]
(F : Type u → Type u)
[traversable F]
[is_lawful_traversable F]
[is_lawful_bitraversable t] :