2 | module Control.Category.Instances.Zero
4 | import Control.Category
5 | import Control.Category.Records
12 | data Zero : (a,b : Void) -> Type where
15 | Uninhabited (Zero a b) where
16 | uninhabited _ impossible
29 | SemigroupoidZero : Semigroupoid Zero
30 | SemigroupoidZero = FromCategory
33 | Either (cat ~=~ Zero) (cat' ~=~ Zero) => CatFunctor cat cat' f where
34 | map @{Left Refl} {a} = void a
35 | map @{Right Refl} {a} = void (f a)
38 | Either (catA ~=~ Zero) (Either (catB ~=~ Zero) (cat' ~=~ Zero)) =>
39 | CatBifunctor catA catB cat' f where
40 | bimap @{Left Refl} {a} = void a
41 | bimap @{Right (Left Refl)} {a'} = void a'
42 | bimap @{Right (Right Refl)} {a,a'} = void (f a a')
45 | CatMonad Zero m where
50 | {ten,i : _} -> Monoidal Zero ten i where
59 | {ten,i : _} -> Braided Zero ten i where
64 | {ten,i : _} -> Cartesian Zero ten i where
72 | {ten,i : _} -> Cocartesian Zero ten i where
80 | {ten,hom,i : _} -> Closed Zero ten hom i where
82 | uncurry {a} = void a
85 | {ten,i : _} -> Traced Zero ten i where
90 | {add,mul,z,i : _} -> Bimonoidal Zero add mul z i where
91 | distribl {a} = void a
92 | distribl' {a} = void a
93 | distribr {a} = void a
94 | distribr' {a} = void a
95 | absorbl {a} = void a
96 | absorbl' {a} = void a
97 | absorbr {a} = void a
98 | absorbr' {a} = void a
105 | namespace SemigroupoidR
107 | Zero : SemigroupoidR
108 | Zero = MkSemigroupoidR Zero
110 | namespace CategoryR
113 | Zero = MkCategoryR Zero
117 | ZeroInitial : FunctorR Zero cat
118 | ZeroInitial = MkFunctorR absurd