1 {-# OPTIONS -XRankNTypes -XMultiParamTypeClasses -XNoMonomorphismRestriction -XTypeOperators #-}
2 module GHC.HetMet.GArrow (
12 class GArrow g (**) where
14 ga_comp :: g x y -> g y z -> g x z
15 ga_first :: g x y -> g (x ** z) (y ** z)
16 ga_second :: g x y -> g (z ** x) (z ** y)
17 ga_cancell :: g (()**x) x
18 ga_cancelr :: g (x**()) x
19 ga_uncancell :: g x (()**x)
20 ga_uncancelr :: g x (x**())
21 ga_assoc :: g ((x**y)**z) (x**(y**z))
22 ga_unassoc :: g (x**(y**z)) ((x**y)**z)
24 class GArrow g (**) => GArrowDrop g (**) where
27 class GArrow g (**) => GArrowCopy g (**) where
30 class GArrow g (**) => GArrowSwap g (**) where
31 ga_swap :: g (x**y) (y**x)
32 --ga_second f = ga_comp (ga_comp ga_swap (ga_first f)) ga_swap
34 class GArrow g (**) => GArrowLoop g (**) where
35 ga_loop :: g (x**z) (y**z) -> g x y
37 class GArrow g (**) => GArrowLiteral g (**) a where
38 ga_literal :: a -> g () a
41 class GArrow g (**) => GArrowReify g (**) where
42 ga_reify :: (x -> y) -> g x y
45 class GArrow g (**) => GArrowReflect g (**) where
46 ga_reflect :: g x y -> (x -> y)