add GHC.HetMet.{hetmet_kappa,hetmet_kappa_app}
[ghc-base.git] / GHC / Desugar.hs
1 {-# LANGUAGE CPP
2            , NoImplicitPrelude
3            , Rank2Types
4            , ExistentialQuantification
5   #-}
6
7 -----------------------------------------------------------------------------
8 -- |
9 -- Module      :  GHC.Desugar
10 -- Copyright   :  (c) The University of Glasgow, 2007
11 -- License     :  see libraries/base/LICENSE
12 -- 
13 -- Maintainer  :  cvs-ghc@haskell.org
14 -- Stability   :  internal
15 -- Portability :  non-portable (GHC extensions)
16 --
17 -- Support code for desugaring in GHC
18 -- 
19 -----------------------------------------------------------------------------
20
21 -- #hide
22 module GHC.Desugar ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where
23
24 import Control.Arrow    (Arrow(..))
25 import Control.Category ((.))
26 import Data.Data        (Data)
27
28 -- A version of Control.Category.>>> overloaded on Arrow
29 #ifndef __HADDOCK__
30 (>>>) :: forall arr. Arrow arr => forall a b c. arr a b -> arr b c -> arr a c
31 #endif
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!
36 f >>> g = g . f
37
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
40
41 toAnnotationWrapper :: (Data a) => a -> AnnotationWrapper
42 toAnnotationWrapper what = AnnotationWrapper what