mirror of
https://github.com/coot/free-category.git
synced 2024-11-29 23:07:40 +03:00
Moved Cat Category instance close to definition
This commit is contained in:
parent
3405380fbf
commit
a8c7f5df27
@ -95,6 +95,14 @@ data Cat (f :: k -> k -> *) a b where
|
||||
-> f a b
|
||||
-> Cat f a c
|
||||
|
||||
instance Category (Cat f) where
|
||||
id = Id
|
||||
|
||||
f . Cat q (g :: g x a)
|
||||
= Cat (q `snoc` op f) g
|
||||
Id . f = f
|
||||
f . Id = f
|
||||
|
||||
arrCat :: forall (f :: k -> k -> *) a b.
|
||||
f a b
|
||||
-> Cat f a b
|
||||
@ -162,14 +170,6 @@ unDual (Cat q (Op (Op tr))) = Cat (hoistQ unDual q) tr
|
||||
{-# INLINE unDual #-}
|
||||
-}
|
||||
|
||||
instance Category (Cat f) where
|
||||
id = Id
|
||||
|
||||
f . Cat q (g :: g x a)
|
||||
= Cat (q `snoc` op f) g
|
||||
Id . f = f
|
||||
f . Id = f
|
||||
|
||||
instance Arrow f => Arrow (Cat f) where
|
||||
arr = arrCat . arr
|
||||
{-# INLINE arr #-}
|
||||
|
Loading…
Reference in New Issue
Block a user