+{-# OPTIONS -XRankNTypes -XMultiParamTypeClasses -XNoMonomorphismRestriction -XTypeOperators -XFlexibleInstances -XFunctionalDependencies #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module : GHC.HetMet.Arrow
+-- Copyright : none
+-- License : public domain
+--
+-- Maintainer : Adam Megacz <megacz@acm.org>
+-- Stability : experimental
+-- Portability : portable
+
+module GHC.HetMet.Arrow where
+import GHC.HetMet.GArrow
+import Control.Arrow
+import Control.Category
+
+------------------------------------------------------------------------------
+-- GArrow instances for Control.Arrow; this is kept in a separate
+-- module because having it available to GHC's instance-search
+-- algorithm often creates overlapping or even undecidable
+-- instance-search problems
+
+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
+
+
+
+
+
+
+