projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3ad8f1f
)
improve comments in GHC.HetMet.GArrow
author
Adam Megacz
<megacz@cs.berkeley.edu>
Sat, 19 Mar 2011 19:32:10 +0000
(12:32 -0700)
committer
Adam Megacz
<megacz@cs.berkeley.edu>
Tue, 31 May 2011 21:59:07 +0000
(14:59 -0700)
GHC/HetMet/GArrow.hs
patch
|
blob
|
history
diff --git
a/GHC/HetMet/GArrow.hs
b/GHC/HetMet/GArrow.hs
index
d31436c
..
da6a9c2
100644
(file)
--- 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 <megacz@acm.org>
+-- Stability : experimental
+-- Portability : portable
+
module GHC.HetMet.GArrow (
GArrow(..),
GArrowDrop(..),
module GHC.HetMet.GArrow (
GArrow(..),
GArrowDrop(..),
@@
-8,6
+18,7
@@
module GHC.HetMet.GArrow (
GArrowReify(..),
GArrowReflect(..)
) where
GArrowReify(..),
GArrowReflect(..)
) where
+import Control.Arrow
class GArrow g (**) where
ga_id :: g x x
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_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 (**) => 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
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
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)
class GArrow g (**) => GArrowReflect g (**) where
ga_reflect :: g x y -> (x -> y)
+