ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

IfaceSyn

Synopsis

- module IfaceType
- data IfaceDecl
  - = IfaceId {
    - ifName :: IfaceTopBndr
    - ifType :: IfaceType
    - ifIdDetails :: IfaceIdDetails
    - ifIdInfo :: IfaceIdInfo
    }
  - | IfaceData {
    - ifName :: IfaceTopBndr
    - ifCType :: Maybe CType
    - ifTyVars :: [IfaceTvBndr]
    - ifRoles :: [Role]
    - ifCtxt :: IfaceContext
    - ifCons :: IfaceConDecls
    - ifRec :: RecFlag
    - ifPromotable :: Bool
    - ifGadtSyntax :: Bool
    - ifParent :: IfaceTyConParent
    }
  - | IfaceSynonym {
    - ifName :: IfaceTopBndr
    - ifTyVars :: [IfaceTvBndr]
    - ifRoles :: [Role]
    - ifSynKind :: IfaceKind
    - ifSynRhs :: IfaceType
    }
  - | IfaceFamily {
    - ifName :: IfaceTopBndr
    - ifTyVars :: [IfaceTvBndr]
    - ifFamKind :: IfaceKind
    - ifFamFlav :: IfaceFamTyConFlav
    }
  - | IfaceClass {
    - ifCtxt :: IfaceContext
    - ifName :: IfaceTopBndr
    - ifTyVars :: [IfaceTvBndr]
    - ifRoles :: [Role]
    - ifFDs :: [FunDep FastString]
    - ifATs :: [IfaceAT]
    - ifSigs :: [IfaceClassOp]
    - ifMinDef :: BooleanFormula IfLclName
    - ifRec :: RecFlag
    }
  - | IfaceAxiom {
    - ifName :: IfaceTopBndr
    - ifTyCon :: IfaceTyCon
    - ifRole :: Role
    - ifAxBranches :: [IfaceAxBranch]
    }
  - | IfacePatSyn {
    - ifName :: IfaceTopBndr
    - ifPatIsInfix :: Bool
    - ifPatMatcher :: (IfExtName, Bool)
    - ifPatBuilder :: Maybe (IfExtName, Bool)
    - ifPatUnivTvs :: [IfaceTvBndr]
    - ifPatExTvs :: [IfaceTvBndr]
    - ifPatProvCtxt :: IfaceContext
    - ifPatReqCtxt :: IfaceContext
    - ifPatArgs :: [IfaceType]
    - ifPatTy :: IfaceType
    }
- data IfaceFamTyConFlav
  - = IfaceOpenSynFamilyTyCon
  - | IfaceClosedSynFamilyTyCon IfExtName [IfaceAxBranch]
  - | IfaceAbstractClosedSynFamilyTyCon
  - | IfaceBuiltInSynFamTyCon
- data IfaceClassOp = IfaceClassOp IfaceTopBndr DefMethSpec IfaceType
- data IfaceAT = IfaceAT IfaceDecl (Maybe IfaceType)
- data IfaceConDecl = IfCon {
  - ifConOcc :: IfaceTopBndr
  - ifConWrapper :: Bool
  - ifConInfix :: Bool
  - ifConExTvs :: [IfaceTvBndr]
  - ifConEqSpec :: IfaceEqSpec
  - ifConCtxt :: IfaceContext
  - ifConArgTys :: [IfaceType]
  - ifConFields :: [IfaceTopBndr]
  - ifConStricts :: [IfaceBang]
  }
- data IfaceConDecls
  - = IfAbstractTyCon Bool
  - | IfDataFamTyCon
  - | IfDataTyCon [IfaceConDecl]
  - | IfNewTyCon IfaceConDecl
- type IfaceEqSpec = [(IfLclName, IfaceType)]
- data IfaceExpr
  - = IfaceLcl IfLclName
  - | IfaceExt IfExtName
  - | IfaceType IfaceType
  - | IfaceCo IfaceCoercion
  - | IfaceTuple TupleSort [IfaceExpr]
  - | IfaceLam IfaceLamBndr IfaceExpr
  - | IfaceApp IfaceExpr IfaceExpr
  - | IfaceCase IfaceExpr IfLclName [IfaceAlt]
  - | IfaceECase IfaceExpr IfaceType
  - | IfaceLet IfaceBinding IfaceExpr
  - | IfaceCast IfaceExpr IfaceCoercion
  - | IfaceLit Literal
  - | IfaceFCall ForeignCall IfaceType
  - | IfaceTick IfaceTickish IfaceExpr
- type IfaceAlt = (IfaceConAlt, [IfLclName], IfaceExpr)
- data IfaceLetBndr = IfLetBndr IfLclName IfaceType IfaceIdInfo
- data IfaceBinding
  - = IfaceNonRec IfaceLetBndr IfaceExpr
  - | IfaceRec [(IfaceLetBndr, IfaceExpr)]
- data IfaceConAlt
  - = IfaceDefault
  - | IfaceDataAlt IfExtName
  - | IfaceLitAlt Literal
- data IfaceIdInfo
  - = NoInfo
  - | HasInfo [IfaceInfoItem]
- data IfaceIdDetails
  - = IfVanillaId
  - | IfRecSelId IfaceTyCon Bool
  - | IfDFunId Int
- data IfaceUnfolding
  - = IfCoreUnfold Bool IfaceExpr
  - | IfCompulsory IfaceExpr
  - | IfInlineRule Arity Bool Bool IfaceExpr
  - | IfDFunUnfold [IfaceBndr] [IfaceExpr]
- data IfaceInfoItem
  - = HsArity Arity
  - | HsStrictness StrictSig
  - | HsInline InlinePragma
  - | HsUnfold Bool IfaceUnfolding
  - | HsNoCafRefs
- data IfaceRule = IfaceRule {
  - ifRuleName :: RuleName
  - ifActivation :: Activation
  - ifRuleBndrs :: [IfaceBndr]
  - ifRuleHead :: IfExtName
  - ifRuleArgs :: [IfaceExpr]
  - ifRuleRhs :: IfaceExpr
  - ifRuleAuto :: Bool
  - ifRuleOrph :: IsOrphan
  }
- data IfaceAnnotation = IfaceAnnotation {
  - ifAnnotatedTarget :: IfaceAnnTarget
  - ifAnnotatedValue :: AnnPayload
  }
- type IfaceAnnTarget = AnnTarget OccName
- data IfaceClsInst = IfaceClsInst {
  - ifInstCls :: IfExtName
  - ifInstTys :: [Maybe IfaceTyCon]
  - ifDFun :: IfExtName
  - ifOFlag :: OverlapFlag
  - ifInstOrph :: IsOrphan
  }
- data IfaceFamInst = IfaceFamInst {
  - ifFamInstFam :: IfExtName
  - ifFamInstTys :: [Maybe IfaceTyCon]
  - ifFamInstAxiom :: IfExtName
  - ifFamInstOrph :: IsOrphan
  }
- data IfaceTickish
  - = IfaceHpcTick Module Int
  - | IfaceSCC CostCentre Bool Bool
  - | IfaceSource RealSrcSpan String
- data IfaceBang
  - = IfNoBang
  - | IfStrict
  - | IfUnpack
  - | IfUnpackCo IfaceCoercion
- data IfaceAxBranch = IfaceAxBranch {
  - ifaxbTyVars :: [IfaceTvBndr]
  - ifaxbLHS :: IfaceTcArgs
  - ifaxbRoles :: [Role]
  - ifaxbRHS :: IfaceType
  - ifaxbIncomps :: [BranchIndex]
  }
- data IfaceTyConParent
  - = IfNoParent
  - | IfDataInstance IfExtName IfaceTyCon IfaceTcArgs
- ifaceDeclImplicitBndrs :: IfaceDecl -> [OccName]
- visibleIfConDecls :: IfaceConDecls -> [IfaceConDecl]
- ifaceDeclFingerprints :: Fingerprint -> IfaceDecl -> [(OccName, Fingerprint)]
- freeNamesIfDecl :: IfaceDecl -> NameSet
- freeNamesIfRule :: IfaceRule -> NameSet
- freeNamesIfFamInst :: IfaceFamInst -> NameSet
- pprIfaceExpr :: (SDoc -> SDoc) -> IfaceExpr -> SDoc
- pprIfaceDecl :: ShowSub -> IfaceDecl -> SDoc
- data ShowSub = ShowSub {
  - ss_ppr_bndr :: OccName -> SDoc
  - ss_how_much :: ShowHowMuch
  }
- data ShowHowMuch
  - = ShowHeader
  - | ShowSome [OccName]
  - | ShowIface

# Documentation

module IfaceType

data IfaceDecl

Constructors

IfaceId |

Fields

ifName :: IfaceTopBndr
ifType :: IfaceType
ifIdDetails :: IfaceIdDetails
ifIdInfo :: IfaceIdInfo

IfaceData |

Fields

ifName :: IfaceTopBndr
ifCType :: Maybe CType
ifTyVars :: [IfaceTvBndr]
ifRoles :: [Role]
ifCtxt :: IfaceContext
ifCons :: IfaceConDecls
ifRec :: RecFlag
ifPromotable :: Bool
ifGadtSyntax :: Bool
ifParent :: IfaceTyConParent

IfaceSynonym |

Fields

ifName :: IfaceTopBndr
ifTyVars :: [IfaceTvBndr]
ifRoles :: [Role]
ifSynKind :: IfaceKind
ifSynRhs :: IfaceType

IfaceFamily |

Fields

ifName :: IfaceTopBndr
ifTyVars :: [IfaceTvBndr]
ifFamKind :: IfaceKind
ifFamFlav :: IfaceFamTyConFlav

IfaceClass |

Fields

ifCtxt :: IfaceContext
ifName :: IfaceTopBndr
ifTyVars :: [IfaceTvBndr]
ifRoles :: [Role]
ifFDs :: [FunDep FastString]
ifATs :: [IfaceAT]
ifSigs :: [IfaceClassOp]
ifMinDef :: BooleanFormula IfLclName
ifRec :: RecFlag

IfaceAxiom |

Fields

ifName :: IfaceTopBndr
ifTyCon :: IfaceTyCon
ifRole :: Role
ifAxBranches :: [IfaceAxBranch]

IfacePatSyn |

Fields

ifName :: IfaceTopBndr
ifPatIsInfix :: Bool
ifPatMatcher :: (IfExtName, Bool)
ifPatBuilder :: Maybe (IfExtName, Bool)
ifPatUnivTvs :: [IfaceTvBndr]
ifPatExTvs :: [IfaceTvBndr]
ifPatProvCtxt :: IfaceContext
ifPatReqCtxt :: IfaceContext
ifPatArgs :: [IfaceType]
ifPatTy :: IfaceType

Instances

Outputable IfaceDecl |
Binary IfaceDecl |
HasOccName IfaceDecl |

data IfaceFamTyConFlav

Constructors

IfaceOpenSynFamilyTyCon |
IfaceClosedSynFamilyTyCon IfExtName [IfaceAxBranch] |
IfaceAbstractClosedSynFamilyTyCon |
IfaceBuiltInSynFamTyCon |

Instances

Binary IfaceFamTyConFlav |

data IfaceClassOp

Constructors

IfaceClassOp IfaceTopBndr DefMethSpec IfaceType |

Instances

Outputable IfaceClassOp |
Binary IfaceClassOp |
HasOccName IfaceClassOp |

data IfaceAT

Constructors

IfaceAT IfaceDecl (Maybe IfaceType) |

Instances

Outputable IfaceAT |
Binary IfaceAT |

data IfaceConDecl

Constructors

IfCon |

Fields

ifConOcc :: IfaceTopBndr
ifConWrapper :: Bool
ifConInfix :: Bool
ifConExTvs :: [IfaceTvBndr]
ifConEqSpec :: IfaceEqSpec
ifConCtxt :: IfaceContext
ifConArgTys :: [IfaceType]
ifConFields :: [IfaceTopBndr]
ifConStricts :: [IfaceBang]

Instances

Binary IfaceConDecl |
HasOccName IfaceConDecl |

data IfaceConDecls

Constructors

IfAbstractTyCon Bool |
IfDataFamTyCon |
IfDataTyCon [IfaceConDecl] |
IfNewTyCon IfaceConDecl |

Instances

Binary IfaceConDecls |

type IfaceEqSpec = [(IfLclName, IfaceType)]

data IfaceExpr

Constructors

IfaceLcl IfLclName |
IfaceExt IfExtName |
IfaceType IfaceType |
IfaceCo IfaceCoercion |
IfaceTuple TupleSort [IfaceExpr] |
IfaceLam IfaceLamBndr IfaceExpr |
IfaceApp IfaceExpr IfaceExpr |
IfaceCase IfaceExpr IfLclName [IfaceAlt] |
IfaceECase IfaceExpr IfaceType |
IfaceLet IfaceBinding IfaceExpr |
IfaceCast IfaceExpr IfaceCoercion |
IfaceLit Literal |
IfaceFCall ForeignCall IfaceType |
IfaceTick IfaceTickish IfaceExpr |

Instances

Outputable IfaceExpr |
Binary IfaceExpr |

type IfaceAlt = (IfaceConAlt, [IfLclName], IfaceExpr)

data IfaceLetBndr

Constructors

IfLetBndr IfLclName IfaceType IfaceIdInfo |

Instances

Binary IfaceLetBndr |

data IfaceBinding

Constructors

IfaceNonRec IfaceLetBndr IfaceExpr |
IfaceRec [(IfaceLetBndr, IfaceExpr)] |

Instances

Binary IfaceBinding |

data IfaceConAlt

Constructors

IfaceDefault |
IfaceDataAlt IfExtName |
IfaceLitAlt Literal |

Instances

Outputable IfaceConAlt |
Binary IfaceConAlt |

data IfaceIdInfo

Constructors

NoInfo |
HasInfo [IfaceInfoItem] |

Instances

Outputable IfaceIdInfo |
Binary IfaceIdInfo |

data IfaceIdDetails

Constructors

IfVanillaId |
IfRecSelId IfaceTyCon Bool |
IfDFunId Int |

Instances

Outputable IfaceIdDetails |
Binary IfaceIdDetails |

data IfaceUnfolding

Constructors

IfCoreUnfold Bool IfaceExpr |
IfCompulsory IfaceExpr |
IfInlineRule Arity Bool Bool IfaceExpr |
IfDFunUnfold [IfaceBndr] [IfaceExpr] |

Instances

Outputable IfaceUnfolding |
Binary IfaceUnfolding |

data IfaceInfoItem

Constructors

HsArity Arity |
HsStrictness StrictSig |
HsInline InlinePragma |
HsUnfold Bool IfaceUnfolding |
HsNoCafRefs |

Instances

Outputable IfaceInfoItem |
Binary IfaceInfoItem |

data IfaceRule

Constructors

IfaceRule |

Fields

ifRuleName :: RuleName
ifActivation :: Activation
ifRuleBndrs :: [IfaceBndr]
ifRuleHead :: IfExtName
ifRuleArgs :: [IfaceExpr]
ifRuleRhs :: IfaceExpr
ifRuleAuto :: Bool
ifRuleOrph :: IsOrphan

Instances

Outputable IfaceRule |
Binary IfaceRule |

data IfaceAnnotation

Constructors

IfaceAnnotation |

Fields

ifAnnotatedTarget :: IfaceAnnTarget
ifAnnotatedValue :: AnnPayload

Instances

Outputable IfaceAnnotation |
Binary IfaceAnnotation |

type IfaceAnnTarget = AnnTarget OccName

data IfaceClsInst

Constructors

IfaceClsInst |

Fields

ifInstCls :: IfExtName
ifInstTys :: [Maybe IfaceTyCon]
ifDFun :: IfExtName
ifOFlag :: OverlapFlag
ifInstOrph :: IsOrphan

Instances

Outputable IfaceClsInst |
Binary IfaceClsInst |

data IfaceFamInst

Constructors

IfaceFamInst |

Fields

ifFamInstFam :: IfExtName
ifFamInstTys :: [Maybe IfaceTyCon]
ifFamInstAxiom :: IfExtName
ifFamInstOrph :: IsOrphan

Instances

Outputable IfaceFamInst |
Binary IfaceFamInst |

data IfaceTickish

Constructors

IfaceHpcTick Module Int |
IfaceSCC CostCentre Bool Bool |
IfaceSource RealSrcSpan String |

Instances

Binary IfaceTickish |

data IfaceBang

Constructors

IfNoBang |
IfStrict |
IfUnpack |
IfUnpackCo IfaceCoercion |

Instances

Binary IfaceBang |

data IfaceAxBranch

Constructors

IfaceAxBranch |

Fields

ifaxbTyVars :: [IfaceTvBndr]
ifaxbLHS :: IfaceTcArgs
ifaxbRoles :: [Role]
ifaxbRHS :: IfaceType
ifaxbIncomps :: [BranchIndex]

Instances

Binary IfaceAxBranch |

data IfaceTyConParent

Constructors

IfNoParent |
IfDataInstance IfExtName IfaceTyCon IfaceTcArgs |

Instances

Outputable IfaceTyConParent |
Binary IfaceTyConParent |

ifaceDeclImplicitBndrs :: IfaceDecl -> [OccName]

visibleIfConDecls :: IfaceConDecls -> [IfaceConDecl]

ifaceDeclFingerprints :: Fingerprint -> IfaceDecl -> [(OccName, Fingerprint)]

freeNamesIfDecl :: IfaceDecl -> NameSet

freeNamesIfRule :: IfaceRule -> NameSet

freeNamesIfFamInst :: IfaceFamInst -> NameSet

pprIfaceExpr :: (SDoc -> SDoc) -> IfaceExpr -> SDoc

Pretty Print an IfaceExpre

The first argument should be a function that adds parens in context that need an atomic value (e.g. function args)

pprIfaceDecl :: ShowSub -> IfaceDecl -> SDoc

data ShowSub

Constructors

ShowSub |

Fields

ss_ppr_bndr :: OccName -> SDoc
ss_how_much :: ShowHowMuch

data ShowHowMuch

Constructors

ShowHeader |
ShowSome [OccName] |
ShowIface |