From: Max Bolingbroke Date: Thu, 16 Oct 2008 12:26:08 +0000 (+0000) Subject: Add AnnotationWrapper type so GHC can capture annotation dictionaries during compilation X-Git-Tag: 2009-06-25~102 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c55fb560777b5fbd966589c47a00bab4756b05fe;p=ghc-base.git Add AnnotationWrapper type so GHC can capture annotation dictionaries during compilation --- diff --git a/GHC/Desugar.hs b/GHC/Desugar.hs index 67ff663..a2c5da2 100644 --- a/GHC/Desugar.hs +++ b/GHC/Desugar.hs @@ -13,10 +13,11 @@ ----------------------------------------------------------------------------- -- #hide -module GHC.Desugar ((>>>)) where +module GHC.Desugar ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where import Control.Arrow (Arrow(..)) import Control.Category ((.)) +import Data.Data (Data) 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 + +-- 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