Constant functors are QPFs #
Constant functors map every type vectors to the same target type. This
is a useful device for constructing data types from more basic types
that are not actually functorial. For instance Const n Nat
makes
Nat
into a functor that can be used in a functor-based data type
specification.
Equations
- MvQPF.Const.inhabited n = { default := default }
@[simp]
@[simp]
Equations
- MvQPF.Const.MvFunctor = { map := fun {α β : TypeVec.{?u.21} n} (_f : α.Arrow β) => MvQPF.Const.map }
theorem
MvQPF.Const.map_mk
{n : ℕ}
{A : Type u}
{α β : TypeVec.{u} n}
(f : α.Arrow β)
(x : A)
:
MvFunctor.map f (Const.mk x) = Const.mk x
theorem
MvQPF.Const.get_map
{n : ℕ}
{A : Type u}
{α β : TypeVec.{u} n}
(f : α.Arrow β)
(x : Const n A α)
:
(MvFunctor.map f x).get = x.get