X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FDesugar.hs;h=65dd645dab82b113ec6c6b8d393cd40f6a505268;hb=be2750a0a11b919fb03cc070074e430f88bdfa90;hp=67ff6638f4674bd6697bee056151bfed5a6467ef;hpb=5b2b5621f83723e22beb4b6cbbf5963ee34d548b;p=ghc-base.git diff --git a/GHC/Desugar.hs b/GHC/Desugar.hs index 67ff663..65dd645 100644 --- a/GHC/Desugar.hs +++ b/GHC/Desugar.hs @@ -1,3 +1,9 @@ +{-# LANGUAGE CPP + , NoImplicitPrelude + , Rank2Types + , ExistentialQuantification + #-} + ----------------------------------------------------------------------------- -- | -- Module : GHC.Desugar @@ -13,11 +19,11 @@ ----------------------------------------------------------------------------- -- #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