-{-# OPTIONS -XRankNTypes -XMultiParamTypeClasses -XNoMonomorphismRestriction -XTypeOperators #-}
+{-# OPTIONS -XRankNTypes -XMultiParamTypeClasses -XNoMonomorphismRestriction -XTypeOperators -XFlexibleInstances #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module : GHC.HetMet.GArrow
+-- Copyright : none
+-- License : public domain
+--
+-- Maintainer : Adam Megacz <megacz@acm.org>
+-- Stability : experimental
+-- Portability : portable
+
module GHC.HetMet.GArrow (
GArrow(..),
GArrowDrop(..),
GArrowReify(..),
GArrowReflect(..)
) where
+import Control.Arrow
class GArrow g (**) where
ga_id :: g x x
ga_copy :: g x (x**x)
class GArrow g (**) => GArrowSwap g (**) where
- ga_swap :: g (x**y) (y**x)
- --ga_second f = ga_comp (ga_comp ga_swap (ga_first f)) ga_swap
+ ga_swap :: g (x**y) (y**x)
+
+-- implementation of ga_second for GArrowSwap instances
+ga_swap_second f = ga_comp (ga_comp ga_swap (ga_first f)) ga_swap
class GArrow g (**) => GArrowLoop g (**) where
ga_loop :: g (x**z) (y**z) -> g x y
class GArrow g (**) => GArrowLiteral g (**) a where
ga_literal :: a -> g () a
--- not sure
+-- not sure -- subject to change
class GArrow g (**) => GArrowReify g (**) where
ga_reify :: (x -> y) -> g x y
--- not sure
+-- not sure -- subject to change
class GArrow g (**) => GArrowReflect g (**) where
ga_reflect :: g x y -> (x -> y)
+