add Arrow=>GArrowProd instance
authorAdam Megacz <megacz@cs.berkeley.edu>
Fri, 8 Apr 2011 04:10:35 +0000 (04:10 +0000)
committerAdam Megacz <megacz@cs.berkeley.edu>
Tue, 31 May 2011 21:59:08 +0000 (14:59 -0700)
GHC/HetMet/Arrow.hs
GHC/HetMet/GArrow.hs

index 08b75b3..b79943a 100644 (file)
@@ -55,6 +55,10 @@ instance ArrowApply a => GArrowApply a (,) () a where
   ga_applyl    = ga_swap >>> app
   ga_applyr    = app
 
+instance Arrow a => GArrowProd a (,) () (,) () where
+  ga_prod_drop  = arr (\x -> ())
+  ga_prod_copy  = arr (\x -> (x,x))
+
 -- The uninhabited type
 data Void
 
index 9f8aab1..9506528 100644 (file)
@@ -75,10 +75,10 @@ ga_swap_second f =
 
 
 class (GArrow     g (**)  u,
-       GArrow     g (<*>) u) =>
-       GArrowProd g (**)  u (<*>) where
+       GArrow     g (<*>) v) =>
+       GArrowProd g (**)  u (<*>) v where
   ga_prod_copy :: g x (x<*>x)
-  ga_prod_drop :: g x  u
+  ga_prod_drop :: g x  v
 
 class (GArrow     g (**)  u,
        GArrow     g (<+>) v) =>