Add Haddock `/Since: 4.7.0.0/` comments to new symbols
[packages/base.git] / GHC / Desugar.hs
1 {-# LANGUAGE Trustworthy #-}
2 {-# LANGUAGE NoImplicitPrelude
3 , RankNTypes
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 (>>>) :: forall arr. Arrow arr => forall a b c. arr a b -> arr b c -> arr a c
30 -- NB: the type of this function is the "shape" that GHC expects
31 -- in tcInstClassOp. So don't put all the foralls at the front!
32 -- Yes, this is a bit grotesque, but heck it works and the whole
33 -- arrows stuff needs reworking anyway!
34 f >>> g = g . f
35
36 -- A wrapper data type that lets the typechecker get at the appropriate dictionaries for an annotation
37 data AnnotationWrapper = forall a. (Data a) => AnnotationWrapper a
38
39 toAnnotationWrapper :: (Data a) => a -> AnnotationWrapper
40 toAnnotationWrapper what = AnnotationWrapper what
41