add Control.Category instance for GArrow
[ghc-base.git] / GHC / HetMet / GArrow.hs
index 93d2886..2f7f5f9 100644 (file)
@@ -19,6 +19,7 @@ module GHC.HetMet.GArrow (
   GArrowReflect(..)
 ) where
 import Control.Arrow
+import Control.Category
 
 class GArrow g (**) where
   ga_id        :: g x x
@@ -94,3 +95,14 @@ instance ArrowLoop a => GArrowLoop a (,) where
   ga_loop      =  loop
 
 
+
+
+------------------------------------------------------------------------------
+-- Category instance for GArrow
+
+instance GArrow g => Category g where
+  id   = ga_id
+  x .y = ga_comp y x
+
+
+