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:
a223a71
)
add Control.Category instance for GArrow
author
Adam Megacz
<megacz@cs.berkeley.edu>
Sat, 19 Mar 2011 19:32:15 +0000
(12:32 -0700)
committer
Adam Megacz
<megacz@cs.berkeley.edu>
Tue, 31 May 2011 21:59:08 +0000
(14:59 -0700)
GHC/HetMet/GArrow.hs
patch
|
blob
|
history
diff --git
a/GHC/HetMet/GArrow.hs
b/GHC/HetMet/GArrow.hs
index
93d2886
..
2f7f5f9
100644
(file)
--- a/
GHC/HetMet/GArrow.hs
+++ b/
GHC/HetMet/GArrow.hs
@@
-19,6
+19,7
@@
module GHC.HetMet.GArrow (
GArrowReflect(..)
) where
import Control.Arrow
+import Control.Category
class GArrow g (**) where
ga_id :: g x x
@@
-94,3
+95,14
@@
instance ArrowLoop a => GArrowLoop a (,) where
ga_loop = loop
+
+
+------------------------------------------------------------------------------
+-- Category instance for GArrow
+
+instance GArrow g => Category g where
+ id = ga_id
+ x .y = ga_comp y x
+
+
+