1 {-# GHC_PRAGMA INTERFACE VERSION 5 #-}
2 interface PlainCore where
4 import BasicLit(BasicLit)
5 import BinderInfo(BinderInfo)
8 import CmdLineOpts(GlobalSwitch)
9 import CoreFuns(atomToExpr, bindersOf, coreExprArity, digForLambdas, escErrorMsg, exprSmallEnoughToDup, instCoreBindings, instCoreExpr, isWrapperFor, manifestlyBottom, manifestlyWHNF, maybeErrorApp, mkCoApps, mkCoLam, mkCoLetAny, mkCoLetNoUnboxed, mkCoLetUnboxedToCase, mkCoLetrecAny, mkCoLetrecNoUnboxed, mkCoLetsAny, mkCoLetsNoUnboxed, mkCoLetsUnboxedToCase, mkCoTyApps, mkCoTyLam, mkCoreIfThenElse, mkErrorCoApp, mkFunction, nonErrorRHSs, pairsFromCoreBinds, squashableDictishCcExpr, substCoreExpr, substCoreExprUS, typeOfCoreAlts, typeOfCoreExpr)
10 import CoreSyn(CoreArg(..), CoreAtom(..), CoreBinding(..), CoreCaseAlternatives(..), CoreCaseDefault(..), CoreExpr(..), applyToArgs, collectArgs, decomposeArgs, mkCoTyApp, pprCoreExpr)
11 import CoreUnfold(calcUnfoldingGuidance, mentionedInUnfolding, pprCoreUnfolding)
12 import CostCentre(CostCentre)
13 import FreeVars(FVCoreBinding(..), FVCoreExpr(..), addTopBindsFVs)
15 import IdEnv(IdEnv(..))
16 import IdInfo(Demand, IdInfo)
18 import NameTypes(FullName)
19 import Outputable(ExportFlag, NamedThing(..), Outputable(..))
20 import PreludePS(_PackedString)
21 import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
22 import PrimOps(PrimOp)
23 import SimplEnv(UnfoldingGuidance)
27 import TyVarEnv(TyVarEnv(..), TypeEnv(..))
28 import UniType(SigmaType(..), TauType(..), ThetaType(..), UniType)
30 import UniqSet(IdSet(..), UniqSet(..))
31 import Unique(UniqSM(..), Unique, UniqueSupply)
32 class NamedThing a where
33 getExportFlag :: a -> ExportFlag
34 isLocallyDefined :: a -> Bool
35 getOrigName :: a -> (_PackedString, _PackedString)
36 getOccurrenceName :: a -> _PackedString
37 getInformingModules :: a -> [_PackedString]
38 getSrcLoc :: a -> SrcLoc
39 getTheUnique :: a -> Unique
41 getType :: a -> UniType
42 fromPreludeCore :: a -> Bool
43 class Outputable a where
44 ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
49 data CoreArg a = TypeArg UniType | ValArg (CoreAtom a)
50 data CoreAtom a = CoVarAtom a | CoLitAtom BasicLit
51 data CoreBinding a b = CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)]
52 data CoreCaseAlternatives a b = CoAlgAlts [(Id, [a], CoreExpr a b)] (CoreCaseDefault a b) | CoPrimAlts [(BasicLit, CoreExpr a b)] (CoreCaseDefault a b)
53 data CoreCaseDefault a b = CoNoDefault | CoBindDefault a (CoreExpr a b)
54 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)
56 type FVCoreBinding = CoreBinding (Id, UniqFM Id) Id
57 type FVCoreExpr = CoreExpr (Id, UniqFM Id) Id
59 type IdEnv a = UniqFM a
65 type PlainCoreArg = CoreArg Id
66 type PlainCoreAtom = CoreAtom Id
67 type PlainCoreBinding = CoreBinding Id Id
68 type PlainCoreCaseAlternatives = CoreCaseAlternatives Id Id
69 type PlainCoreCaseDefault = CoreCaseDefault Id Id
70 type PlainCoreExpr = CoreExpr Id Id
71 type PlainCoreProgram = [CoreBinding Id Id]
73 type Pretty = Int -> Bool -> PrettyRep
76 data UnfoldingGuidance
80 type TyVarEnv a = UniqFM a
81 type TypeEnv = UniqFM UniType
82 type SigmaType = UniType
83 type TauType = UniType
84 type ThetaType = [(Class, UniType)]
87 type IdSet = UniqFM Id
88 type UniqSet a = UniqFM a
89 type UniqSM a = UniqueSupply -> (UniqueSupply, a)
92 atomToExpr :: CoreAtom b -> CoreExpr a b
93 bindersOf :: CoreBinding b a -> [b]
94 coreExprArity :: (Id -> Labda (CoreExpr a Id)) -> CoreExpr a Id -> Int
95 digForLambdas :: CoreExpr a b -> ([TyVar], [a], CoreExpr a b)
96 escErrorMsg :: [Char] -> [Char]
97 exprSmallEnoughToDup :: CoreExpr a Id -> Bool
98 instCoreBindings :: UniqueSupply -> [CoreBinding Id Id] -> (UniqueSupply, [CoreBinding Id Id])
99 instCoreExpr :: UniqueSupply -> CoreExpr Id Id -> (UniqueSupply, CoreExpr Id Id)
100 isWrapperFor :: CoreExpr Id Id -> Id -> Bool
101 manifestlyBottom :: CoreExpr a Id -> Bool
102 manifestlyWHNF :: CoreExpr a Id -> Bool
103 maybeErrorApp :: CoreExpr a Id -> Labda UniType -> Labda (CoreExpr a Id)
104 mkCoApps :: CoreExpr Id Id -> [CoreExpr Id Id] -> UniqueSupply -> (UniqueSupply, CoreExpr Id Id)
105 mkCoLam :: [a] -> CoreExpr a b -> CoreExpr a b
106 mkCoLetAny :: CoreBinding Id Id -> CoreExpr Id Id -> CoreExpr Id Id
107 mkCoLetNoUnboxed :: CoreBinding Id Id -> CoreExpr Id Id -> CoreExpr Id Id
108 mkCoLetUnboxedToCase :: CoreBinding Id Id -> CoreExpr Id Id -> CoreExpr Id Id
109 mkCoLetrecAny :: [(Id, CoreExpr Id Id)] -> CoreExpr Id Id -> CoreExpr Id Id
110 mkCoLetrecNoUnboxed :: [(Id, CoreExpr Id Id)] -> CoreExpr Id Id -> CoreExpr Id Id
111 mkCoLetsAny :: [CoreBinding Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
112 mkCoLetsNoUnboxed :: [CoreBinding Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
113 mkCoLetsUnboxedToCase :: [CoreBinding Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
114 mkCoTyApps :: CoreExpr a b -> [UniType] -> CoreExpr a b
115 mkCoTyLam :: [TyVar] -> CoreExpr a b -> CoreExpr a b
116 mkCoreIfThenElse :: CoreExpr a Id -> CoreExpr a Id -> CoreExpr a Id -> CoreExpr a Id
117 mkErrorCoApp :: UniType -> Id -> [Char] -> CoreExpr Id Id
118 mkFunction :: [TyVar] -> [a] -> CoreExpr a b -> CoreExpr a b
119 nonErrorRHSs :: CoreCaseAlternatives a Id -> [CoreExpr a Id]
120 pairsFromCoreBinds :: [CoreBinding a b] -> [(a, CoreExpr a b)]
121 squashableDictishCcExpr :: CostCentre -> CoreExpr a b -> Bool
122 substCoreExpr :: UniqueSupply -> UniqFM (CoreExpr Id Id) -> UniqFM UniType -> CoreExpr Id Id -> (UniqueSupply, CoreExpr Id Id)
123 substCoreExprUS :: UniqFM (CoreExpr Id Id) -> UniqFM UniType -> CoreExpr Id Id -> UniqueSupply -> (UniqueSupply, CoreExpr Id Id)
124 typeOfCoreAlts :: CoreCaseAlternatives Id Id -> UniType
125 typeOfCoreExpr :: CoreExpr Id Id -> UniType
126 applyToArgs :: CoreExpr a b -> [CoreArg b] -> CoreExpr a b
127 collectArgs :: CoreExpr a b -> (CoreExpr a b, [CoreArg b])
128 decomposeArgs :: [CoreArg a] -> ([UniType], [CoreAtom a], [CoreArg a])
129 mkCoTyApp :: CoreExpr a b -> UniType -> CoreExpr a b
130 pprCoreExpr :: PprStyle -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> b -> Int -> Bool -> PrettyRep) -> CoreExpr a b -> Int -> Bool -> PrettyRep
131 calcUnfoldingGuidance :: Bool -> Int -> CoreExpr Id Id -> UnfoldingGuidance
132 mentionedInUnfolding :: (a -> Id) -> CoreExpr a Id -> ([Id], [TyCon], [Class], Bool)
133 pprCoreUnfolding :: CoreExpr Id Id -> Int -> Bool -> PrettyRep
134 addTopBindsFVs :: (UniqFM Id -> Id -> Bool) -> [CoreBinding Id Id] -> ([CoreBinding (Id, UniqFM Id) Id], UniqFM Id)
135 pprBigCoreBinder :: PprStyle -> Id -> Int -> Bool -> PrettyRep
136 pprPlainCoreBinding :: PprStyle -> CoreBinding Id Id -> Int -> Bool -> PrettyRep
137 pprTypedCoreBinder :: PprStyle -> Id -> Int -> Bool -> PrettyRep
147 instance NamedThing Class
148 instance NamedThing Id
149 instance NamedThing FullName
150 instance (Outputable a, Outputable b) => Outputable (a, b)
151 instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c)
152 instance Outputable Bool
153 instance Outputable Class
154 instance Outputable a => Outputable (CoreArg a)
155 instance Outputable a => Outputable (CoreAtom a)
156 instance (Outputable a, Outputable b) => Outputable (CoreBinding a b)
157 instance (Outputable a, Outputable b) => Outputable (CoreCaseAlternatives a b)
158 instance (Outputable a, Outputable b) => Outputable (CoreCaseDefault a b)
159 instance (Outputable a, Outputable b) => Outputable (CoreExpr a b)
160 instance Outputable Id
161 instance Outputable Demand
162 instance Outputable FullName
163 instance Outputable UniType
164 instance Outputable a => Outputable [a]