add Control.Category instance for GArrow
authorAdam Megacz <megacz@cs.berkeley.edu>
Sat, 19 Mar 2011 19:32:15 +0000 (12:32 -0700)
committerAdam Megacz <megacz@cs.berkeley.edu>
Tue, 31 May 2011 21:59:08 +0000 (14:59 -0700)
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
+
+
+