One more GHC.Err import eliminated
[packages/base.git] / GHC / Desugar.hs
1 {-# LANGUAGE Trustworthy #-}
2 {-# LANGUAGE CPP
3 , NoImplicitPrelude
4 , RankNTypes
5 , ExistentialQuantification
6 #-}
7
8 -----------------------------------------------------------------------------
9 -- |
10 -- Module : GHC.Desugar
11 -- Copyright : (c) The University of Glasgow, 2007
12 -- License : see libraries/base/LICENSE
13 --
14 -- Maintainer : cvs-ghc@haskell.org
15 -- Stability : internal
16 -- Portability : non-portable (GHC extensions)
17 --
18 -- Support code for desugaring in GHC
19 --
20 -----------------------------------------------------------------------------
21
22 -- #hide
23 module GHC.Desugar ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where
24
25 import Control.Arrow (Arrow(..))
26 import Control.Category ((.))
27 import Data.Data (Data)
28
29 -- 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
31 -- NB: the type of this function is the "shape" that GHC expects
32 -- in tcInstClassOp. So don't put all the foralls at the front!
33 -- Yes, this is a bit grotesque, but heck it works and the whole
34 -- arrows stuff needs reworking anyway!
35 f >>> g = g . f
36
37 -- A wrapper data type that lets the typechecker get at the appropriate dictionaries for an annotation
38 data AnnotationWrapper = forall a. (Data a) => AnnotationWrapper a
39
40 toAnnotationWrapper :: (Data a) => a -> AnnotationWrapper
41 toAnnotationWrapper what = AnnotationWrapper what
42