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 : _} -> MonSymmetric Zero ten i where
68 | {ten,i : _} -> Cartesian Zero ten i where
76 | {ten,i : _} -> Cocartesian Zero ten i where
84 | {ten,hom,i : _} -> Closed Zero ten hom i where
89 | {ten,i : _} -> Traced Zero ten i where
94 | {add,mul,z,i : _} -> Bimonoidal Zero add mul z i where
109 | namespace SemigroupoidR
111 | Zero : SemigroupoidR
112 | Zero = MkSemigroupoidR Zero
114 | namespace CategoryR
117 | Zero = MkCategoryR Zero
121 | ZeroInitial : FunctorR Zero cat
122 | ZeroInitial = MkFunctorR absurd