mirror of
https://github.com/coot/free-category.git
synced 2024-12-02 12:22:04 +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
|
-> f a b
|
||||||
-> Cat f a c
|
-> 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.
|
arrCat :: forall (f :: k -> k -> *) a b.
|
||||||
f a b
|
f a b
|
||||||
-> Cat f a b
|
-> Cat f a b
|
||||||
@ -162,14 +170,6 @@ unDual (Cat q (Op (Op tr))) = Cat (hoistQ unDual q) tr
|
|||||||
{-# INLINE unDual #-}
|
{-# 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
|
instance Arrow f => Arrow (Cat f) where
|
||||||
arr = arrCat . arr
|
arr = arrCat . arr
|
||||||
{-# INLINE arr #-}
|
{-# INLINE arr #-}
|
||||||
|
Loading…
Reference in New Issue
Block a user