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