move the (Arrow a)=>(GArrow a (,)) instance to a separate file
[ghc-base.git] / GHC / HetMet / GArrow.hs
index 9853637..e1ac446 100644 (file)
@@ -16,9 +16,9 @@ module GHC.HetMet.GArrow (
   GArrowSwap(..),
   GArrowLoop(..),
   GArrowReify(..),
-  GArrowReflect(..)
+  GArrowReflect(..),
+  GArrowLiteral(..)
 ) where
-import Control.Arrow
 import Control.Category
 
 class Category g => GArrow g (**) | g -> (**) where
@@ -57,39 +57,3 @@ class GArrow g (**) => GArrowReify g (**) where
 class GArrow g (**) => GArrowReflect g (**) where
   ga_reflect   :: g x y -> (x -> y)
 
-
-
-------------------------------------------------------------------------------
--- GArrow instances for Control.Arrow
-
-instance Arrow a => GArrow a (,) where
-  ga_first     =  first
-  ga_second    =  second
-  ga_cancell   =  arr (\((),x) -> x)
-  ga_cancelr   =  arr (\(x,()) -> x)
-  ga_uncancell =  arr (\x -> ((),x))
-  ga_uncancelr =  arr (\x -> (x,()))
-  ga_assoc     =  arr (\((x,y),z) -> (x,(y,z)))
-  ga_unassoc   =  arr (\(x,(y,z)) -> ((x,y),z))
-  
-instance Arrow a => GArrowDrop a (,) where
-  ga_drop      =  arr (\x -> ())
-
-instance Arrow a => GArrowCopy a (,) where
-  ga_copy      =  arr (\x -> (x,x))
-
-instance Arrow a => GArrowSwap a (,) where
-  ga_swap      =  arr (\(x,y) -> (y,x))
-
-instance Arrow a => GArrowLiteral a (,) b where
-  ga_literal x =  arr (\() -> x)
-
-instance Arrow a => GArrowReify a (,) where
-  ga_reify     =  arr
-
-instance ArrowLoop a => GArrowLoop a (,) where
-  ga_loop      =  loop
-
-
-
-