From 28aab94598bf79fd5dc005d71934555f330b0ad7 Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Sat, 19 Mar 2011 12:32:10 -0700 Subject: [PATCH] improve comments in GHC.HetMet.GArrow --- GHC/HetMet/GArrow.hs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/GHC/HetMet/GArrow.hs b/GHC/HetMet/GArrow.hs index d31436c..da6a9c2 100644 --- a/GHC/HetMet/GArrow.hs +++ b/GHC/HetMet/GArrow.hs @@ -1,4 +1,14 @@ -{-# OPTIONS -XRankNTypes -XMultiParamTypeClasses -XNoMonomorphismRestriction -XTypeOperators #-} +{-# OPTIONS -XRankNTypes -XMultiParamTypeClasses -XNoMonomorphismRestriction -XTypeOperators -XFlexibleInstances #-} +----------------------------------------------------------------------------- +-- | +-- Module : GHC.HetMet.GArrow +-- Copyright : none +-- License : public domain +-- +-- Maintainer : Adam Megacz +-- Stability : experimental +-- Portability : portable + module GHC.HetMet.GArrow ( GArrow(..), GArrowDrop(..), @@ -8,6 +18,7 @@ module GHC.HetMet.GArrow ( GArrowReify(..), GArrowReflect(..) ) where +import Control.Arrow class GArrow g (**) where ga_id :: g x x @@ -28,8 +39,10 @@ class GArrow g (**) => GArrowCopy g (**) where 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 @@ -37,12 +50,13 @@ class GArrow g (**) => GArrowLoop g (**) where 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) + -- 1.7.10.4