Add tests from testsuite/tests/h98
[ghc-base.git] / GHC / Desugar.hs
index 67ff663..65dd645 100644 (file)
@@ -1,3 +1,9 @@
+{-# LANGUAGE CPP
+           , NoImplicitPrelude
+           , Rank2Types
+           , ExistentialQuantification
+  #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  GHC.Desugar
 -----------------------------------------------------------------------------
 
 -- #hide
-module GHC.Desugar ((>>>)) where
+module GHC.Desugar ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where
 
 import Control.Arrow    (Arrow(..))
 import Control.Category ((.))
-import Prelude hiding ((.))
+import Data.Data        (Data)
 
 -- A version of Control.Category.>>> overloaded on Arrow
 #ifndef __HADDOCK__
@@ -28,3 +34,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
+
+-- 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