1
1
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:
Marcin Szamotulski 2019-09-05 09:03:23 +02:00
parent 3405380fbf
commit a8c7f5df27

View File

@ -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 #-}