2 | import public Data.Category.Ops
8 | record Category (o : Type) where
9 | constructor MkCategory
10 | 0 (~:>) : o -> o -> Type
11 | id : (v : o) -> v ~:> v
12 | (|:>) : {0 a, b, c : o} -> (a ~:> b) -> (b ~:> c) -> (a ~:> c)
13 | 0 idLeft : {a, b : o} -> (f : a ~:> b) -> f |:> id b = f
14 | 0 idRight : {a, b : o} -> (f : a ~:> b) -> id a |:> f = f
15 | 0 compAssoc : {a, b, c, d : o} ->
19 | f |:> (g |:> h) = (f |:> g) |:> h
23 | 0 (~>) : (cat : Category o) => o -> o -> Type
24 | (~>) = Category.(~:>) cat
28 | (|>) : (cat : Category o) => {0 a, b, c : o} ->
29 | a ~> b -> b ~> c -> a ~> c
30 | (|>) = Category.(|:>) cat
34 | (.op) : Category o -> Category o
35 | (.op) cat = MkCategory
38 | (\f, g => (|:>) cat g f )
41 | (\f, g, h => sym (cat.compAssoc h g f))
44 | Idris : Category Type