ITree.Indexed.Function
The Category of Indexed Functions
The name of the category.
Unwrap IFun, potentially useful for type inference.
Unwrap IFun as ~>.
Wrap ~> as IFun.
Equivalence of indexed functions is extensional equality.
The identity function.
Function composition.
void1 is the initial object.
The coproduct is case analysis on sums.
Definition case_sum1 {A B C : Type → Type} (f : A ~> C) (g : B ~> C)
: A +' B ~> C
:= fun _ ab ⇒
match ab with
| inl1 a ⇒ f _ a
| inr1 b ⇒ g _ b
end.
#[global] Instance Case_sum1 : Case IFun sum1 := @case_sum1.
#[global] Instance Inl_sum1 : Inl IFun sum1 := @inl1.
#[global] Instance Inr_sum1 : Inr IFun sum1 := @inr1.
: A +' B ~> C
:= fun _ ab ⇒
match ab with
| inl1 a ⇒ f _ a
| inr1 b ⇒ g _ b
end.
#[global] Instance Case_sum1 : Case IFun sum1 := @case_sum1.
#[global] Instance Inl_sum1 : Inl IFun sum1 := @inl1.
#[global] Instance Inr_sum1 : Inr IFun sum1 := @inr1.