0 | module Data.Category.Graded
2 | import public Data.List.Quantifiers as QL
6 | OneOf : List Type -> Type
7 | OneOf = QL.Any.Any id
12 | left : QL.Any.Any p xs -> QL.Any.Any p (xs ++ ys)
13 | left (Here x) = Here x
14 | left (There x) = There (left x)
17 | right : {ys : _} -> QL.Any.Any p xs -> QL.Any.Any p (ys ++ xs)
18 | right {ys = []} x = x
19 | right {ys = (y :: ys)} x = There (right x)
25 | interface GradedCat (mon : Monoid gr) (0 arr : gr -> obj -> obj -> Type) | arr where
26 | constructor MkGradedCat
29 | identity : forall x. arr Prelude.Interfaces.neutral x x
32 | (#>) : forall x, y, z. {g1, g2 : _} -> arr g1 x y -> arr g2 y z -> arr (g1 <+> g2) x z
38 | [EitherSem] Semigroup Type where
43 | [EitherMon] Monoid Type using EitherSem where
48 | [AnySem] Semigroup (List Type) where
53 | [AnyMon] Monoid (List Type) using EitherSem where
61 | GradedCoproductMonad : {0 e : Type} -> (e -> Type) -> e -> Type -> Type -> Type
62 | GradedCoproductMonad f e x y = (x -> Either (f e) y)
66 | EitherGradeMor : Type -> Type -> Type -> Type
67 | EitherGradeMor e x y = GradedCoproductMonad id e x y
71 | AnyErrGradeMor : List Type -> Type -> Type -> Type
72 | AnyErrGradeMor e x y = GradedCoproductMonad OneOf e x y