1 -----------------------------------------------------------------------------
3 -- Module : GHC.Desugar
4 -- Copyright : (c) The University of Glasgow, 2007
5 -- License : see libraries/base/LICENSE
7 -- Maintainer : cvs-ghc@haskell.org
8 -- Stability : internal
9 -- Portability : non-portable (GHC extensions)
11 -- Support code for desugaring in GHC
13 -----------------------------------------------------------------------------
16 module GHC.Desugar ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where
18 import Control.Arrow (Arrow(..))
19 import Control.Category ((.))
20 import Data.Data (Data)
22 -- A version of Control.Category.>>> overloaded on Arrow
24 (>>>) :: forall arr. Arrow arr => forall a b c. arr a b -> arr b c -> arr a c
26 -- NB: the type of this function is the "shape" that GHC expects
27 -- in tcInstClassOp. So don't put all the foralls at the front!
28 -- Yes, this is a bit grotesque, but heck it works and the whole
29 -- arrows stuff needs reworking anyway!
32 -- A wrapper data type that lets the typechecker get at the appropriate dictionaries for an annotation
33 data AnnotationWrapper = forall a. (Data a) => AnnotationWrapper a
35 toAnnotationWrapper :: (Data a) => a -> AnnotationWrapper
36 toAnnotationWrapper what = AnnotationWrapper what