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:
e4a135d
)
Add AnnotationWrapper type so GHC can capture annotation dictionaries during compilation
author
Max Bolingbroke
<batterseapower@hotmail.com>
Thu, 16 Oct 2008 12:26:08 +0000
(12:26 +0000)
committer
Max Bolingbroke
<batterseapower@hotmail.com>
Thu, 16 Oct 2008 12:26:08 +0000
(12:26 +0000)
GHC/Desugar.hs
patch
|
blob
|
history
diff --git
a/GHC/Desugar.hs
b/GHC/Desugar.hs
index
67ff663
..
a2c5da2
100644
(file)
--- a/
GHC/Desugar.hs
+++ b/
GHC/Desugar.hs
@@
-13,10
+13,11
@@
-----------------------------------------------------------------------------
-- #hide
-----------------------------------------------------------------------------
-- #hide
-module GHC.Desugar ((>>>)) where
+module GHC.Desugar ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where
import Control.Arrow (Arrow(..))
import Control.Category ((.))
import Control.Arrow (Arrow(..))
import Control.Category ((.))
+import Data.Data (Data)
import Prelude hiding ((.))
-- A version of Control.Category.>>> overloaded on Arrow
import Prelude hiding ((.))
-- A version of Control.Category.>>> overloaded on Arrow
@@
-28,3
+29,9
@@
import Prelude hiding ((.))
-- Yes, this is a bit grotesque, but heck it works and the whole
-- arrows stuff needs reworking anyway!
f >>> g = g . f
-- Yes, this is a bit grotesque, but heck it works and the whole
-- arrows stuff needs reworking anyway!
f >>> g = g . f
+
+-- A wrapper data type that lets the typechecker get at the appropriate dictionaries for an annotation
+data AnnotationWrapper = forall a. (Data a) => AnnotationWrapper a
+
+toAnnotationWrapper :: (Data a) => a -> AnnotationWrapper
+toAnnotationWrapper what = AnnotationWrapper what
\ No newline at end of file