1 {-# GHC_PRAGMA INTERFACE VERSION 5 #-}
2 interface TaggedCore where
3 import BasicLit(BasicLit)
4 import BinderInfo(BinderInfo)
5 import CmdLineOpts(GlobalSwitch)
6 import CoreFuns(unTagBinders, unTagBindersAlts)
7 import CoreSyn(CoreArg(..), CoreAtom(..), CoreBinding(..), CoreCaseAlternatives(..), CoreCaseDefault(..), CoreExpr(..), applyToArgs, collectArgs, decomposeArgs)
8 import CostCentre(CostCentre)
10 import Outputable(ExportFlag, NamedThing(..), Outputable(..))
11 import PreludePS(_PackedString)
12 import Pretty(PprStyle, Pretty(..), PrettyRep)
13 import PrimOps(PrimOp)
17 import UniType(UniType)
19 class NamedThing a where
20 getExportFlag :: a -> ExportFlag
21 isLocallyDefined :: a -> Bool
22 getOrigName :: a -> (_PackedString, _PackedString)
23 getOccurrenceName :: a -> _PackedString
24 getInformingModules :: a -> [_PackedString]
25 getSrcLoc :: a -> SrcLoc
26 getTheUnique :: a -> Unique
28 getType :: a -> UniType
29 fromPreludeCore :: a -> Bool
30 class Outputable a where
31 ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
35 data CoreArg a = TypeArg UniType | ValArg (CoreAtom a)
36 data CoreAtom a = CoVarAtom a | CoLitAtom BasicLit
37 data CoreBinding a b = CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)]
38 data CoreCaseAlternatives a b = CoAlgAlts [(Id, [a], CoreExpr a b)] (CoreCaseDefault a b) | CoPrimAlts [(BasicLit, CoreExpr a b)] (CoreCaseDefault a b)
39 data CoreCaseDefault a b = CoNoDefault | CoBindDefault a (CoreExpr a b)
40 data CoreExpr a b = CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b)
45 type Pretty = Int -> Bool -> PrettyRep
48 type SimplifiableBinder = (Id, BinderInfo)
49 type SimplifiableCoreAtom = CoreAtom Id
50 type SimplifiableCoreBinding = CoreBinding (Id, BinderInfo) Id
51 type SimplifiableCoreCaseAlternatives = CoreCaseAlternatives (Id, BinderInfo) Id
52 type SimplifiableCoreCaseDefault = CoreCaseDefault (Id, BinderInfo) Id
53 type SimplifiableCoreExpr = CoreExpr (Id, BinderInfo) Id
55 type TaggedBinder a = (Id, a)
56 type TaggedCoreAtom a = CoreAtom Id
57 type TaggedCoreBinding a = CoreBinding (Id, a) Id
58 type TaggedCoreCaseAlternatives a = CoreCaseAlternatives (Id, a) Id
59 type TaggedCoreCaseDefault a = CoreCaseDefault (Id, a) Id
60 type TaggedCoreExpr a = CoreExpr (Id, a) Id
65 unTagBinders :: CoreExpr (Id, a) b -> CoreExpr Id b
66 unTagBindersAlts :: CoreCaseAlternatives (Id, a) b -> CoreCaseAlternatives Id b
67 applyToArgs :: CoreExpr a b -> [CoreArg b] -> CoreExpr a b
68 collectArgs :: CoreExpr a b -> (CoreExpr a b, [CoreArg b])
69 decomposeArgs :: [CoreArg a] -> ([UniType], [CoreAtom a], [CoreArg a])
70 instance (Outputable a, Outputable b) => Outputable (a, b)
71 instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c)
72 instance Outputable BinderInfo
73 instance Outputable Bool
74 instance Outputable a => Outputable (CoreArg a)
75 instance Outputable a => Outputable (CoreAtom a)
76 instance (Outputable a, Outputable b) => Outputable (CoreBinding a b)
77 instance (Outputable a, Outputable b) => Outputable (CoreCaseAlternatives a b)
78 instance (Outputable a, Outputable b) => Outputable (CoreCaseDefault a b)
79 instance (Outputable a, Outputable b) => Outputable (CoreExpr a b)
80 instance Outputable a => Outputable [a]