ghc-7.4.2: The GHC API

Safe Haskell | None

IfaceSyn

Synopsis

- module IfaceType
- data IfaceDecl
  - = IfaceId {
    - ifName :: OccName
    - ifType :: IfaceType
    - ifIdDetails :: IfaceIdDetails
    - ifIdInfo :: IfaceIdInfo
    }
  - | IfaceData {
    - ifName :: OccName
    - ifTyVars :: [IfaceTvBndr]
    - ifCtxt :: IfaceContext
    - ifCons :: IfaceConDecls
    - ifRec :: RecFlag
    - ifGadtSyntax :: Bool
    - ifFamInst :: Maybe (IfaceTyCon, [IfaceType])
    }
  - | IfaceSyn {
    - ifName :: OccName
    - ifTyVars :: [IfaceTvBndr]
    - ifSynKind :: IfaceKind
    - ifSynRhs :: Maybe IfaceType
    - ifFamInst :: Maybe (IfaceTyCon, [IfaceType])
    }
  - | IfaceClass {
    - ifCtxt :: IfaceContext
    - ifName :: OccName
    - ifTyVars :: [IfaceTvBndr]
    - ifFDs :: [FunDep FastString]
    - ifATs :: [IfaceAT]
    - ifSigs :: [IfaceClassOp]
    - ifRec :: RecFlag
    }
  - | IfaceForeign {
    - ifName :: OccName
    - ifExtName :: Maybe FastString
    }
- data IfaceClassOp = IfaceClassOp OccName DefMethSpec IfaceType
- data IfaceAT = IfaceAT IfaceDecl [IfaceATDefault]
- data IfaceATDefault = IfaceATD [IfaceTvBndr] [IfaceType] IfaceType
- data IfaceConDecl = IfCon {
  - ifConOcc :: OccName
  - ifConWrapper :: Bool
  - ifConInfix :: Bool
  - ifConUnivTvs :: [IfaceTvBndr]
  - ifConExTvs :: [IfaceTvBndr]
  - ifConEqSpec :: [(OccName, IfaceType)]
  - ifConCtxt :: IfaceContext
  - ifConArgTys :: [IfaceType]
  - ifConFields :: [OccName]
  - ifConStricts :: [HsBang]
  }
- data IfaceConDecls
  - = IfAbstractTyCon Bool
  - | IfOpenDataTyCon
  - | IfDataTyCon [IfaceConDecl]
  - | IfNewTyCon IfaceConDecl
- data IfaceExpr
  - = IfaceLcl IfLclName
  - | IfaceExt IfExtName
  - | IfaceType IfaceType
  - | IfaceCo IfaceType
  - | IfaceTuple TupleSort [IfaceExpr]
  - | IfaceLam IfaceBndr IfaceExpr
  - | IfaceApp IfaceExpr IfaceExpr
  - | IfaceCase IfaceExpr IfLclName [IfaceAlt]
  - | 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
- data IfaceUnfolding
  - = IfCoreUnfold Bool IfaceExpr
  - | IfCompulsory IfaceExpr
  - | IfInlineRule Arity Bool Bool IfaceExpr
  - | IfExtWrapper Arity IfExtName
  - | IfLclWrapper Arity IfLclName
  - | IfDFunUnfold [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 :: Maybe OccName
  }
- data IfaceAnnotation = IfaceAnnotation {
  - ifAnnotatedTarget :: IfaceAnnTarget
  - ifAnnotatedValue :: Serialized
  }
- type IfaceAnnTarget = AnnTarget OccName
- data IfaceInst = IfaceInst {
  - ifInstCls :: IfExtName
  - ifInstTys :: [Maybe IfaceTyCon]
  - ifDFun :: IfExtName
  - ifOFlag :: OverlapFlag
  - ifInstOrph :: Maybe OccName
  }
- data IfaceFamInst = IfaceFamInst {
  - ifFamInstFam :: IfExtName
  - ifFamInstTys :: [Maybe IfaceTyCon]
  - ifFamInstTyCon :: IfaceTyCon
  }
- data IfaceTickish
  - = IfaceHpcTick Module Int
  - | IfaceSCC CostCentre Bool Bool
- ifaceDeclSubBndrs :: IfaceDecl -> [OccName]
- visibleIfConDecls :: IfaceConDecls -> [IfaceConDecl]
- freeNamesIfDecl :: IfaceDecl -> NameSet
- freeNamesIfRule :: IfaceRule -> NameSet
- pprIfaceExpr :: (SDoc -> SDoc) -> IfaceExpr -> SDoc
- pprIfaceDeclHead :: IfaceContext -> OccName -> [IfaceTvBndr] -> SDoc

# Documentation

module IfaceType

data IfaceDecl

Constructors

IfaceId |

Fields

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

IfaceData |

Fields

ifName :: OccName
ifTyVars :: [IfaceTvBndr]
ifCtxt :: IfaceContext
ifCons :: IfaceConDecls
ifRec :: RecFlag
ifGadtSyntax :: Bool
ifFamInst :: Maybe (IfaceTyCon, [IfaceType])

IfaceSyn |

Fields

ifName :: OccName
ifTyVars :: [IfaceTvBndr]
ifSynKind :: IfaceKind
ifSynRhs :: Maybe IfaceType
ifFamInst :: Maybe (IfaceTyCon, [IfaceType])

IfaceClass |

Fields

ifCtxt :: IfaceContext
ifName :: OccName
ifTyVars :: [IfaceTvBndr]
ifFDs :: [FunDep FastString]
ifATs :: [IfaceAT]
ifSigs :: [IfaceClassOp]
ifRec :: RecFlag

IfaceForeign |

Fields

ifName :: OccName
ifExtName :: Maybe FastString

Instances

Outputable IfaceDecl |
Binary IfaceDecl |

data IfaceClassOp

Constructors

IfaceClassOp OccName DefMethSpec IfaceType |

Instances

Outputable IfaceClassOp |
Binary IfaceClassOp |

data IfaceAT

Constructors

IfaceAT IfaceDecl [IfaceATDefault] |

Instances

Outputable IfaceAT |
Binary IfaceAT |

data IfaceATDefault

Constructors

IfaceATD [IfaceTvBndr] [IfaceType] IfaceType |

Instances

Outputable IfaceATDefault |
Binary IfaceATDefault |

data IfaceConDecl

Constructors

IfCon |

Fields

ifConOcc :: OccName
ifConWrapper :: Bool
ifConInfix :: Bool
ifConUnivTvs :: [IfaceTvBndr]
ifConExTvs :: [IfaceTvBndr]
ifConEqSpec :: [(OccName, IfaceType)]
ifConCtxt :: IfaceContext
ifConArgTys :: [IfaceType]
ifConFields :: [OccName]
ifConStricts :: [HsBang]

Instances

Binary IfaceConDecl |

data IfaceConDecls

Constructors

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

Instances

Binary IfaceConDecls |

data IfaceExpr

Constructors

IfaceLcl IfLclName |
IfaceExt IfExtName |
IfaceType IfaceType |
IfaceCo IfaceType |
IfaceTuple TupleSort [IfaceExpr] |
IfaceLam IfaceBndr IfaceExpr |
IfaceApp IfaceExpr IfaceExpr |
IfaceCase IfaceExpr IfLclName [IfaceAlt] |
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 |

Instances

Outputable IfaceIdDetails |
Binary IfaceIdDetails |

data IfaceUnfolding

Constructors

IfCoreUnfold Bool IfaceExpr |
IfCompulsory IfaceExpr |
IfInlineRule Arity Bool Bool IfaceExpr |
IfExtWrapper Arity IfExtName |
IfLclWrapper Arity IfLclName |
IfDFunUnfold [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 :: Maybe OccName

Instances

Outputable IfaceRule |
Binary IfaceRule |

data IfaceAnnotation

Constructors

IfaceAnnotation |

Fields

ifAnnotatedTarget :: IfaceAnnTarget
ifAnnotatedValue :: Serialized

Instances

Binary IfaceAnnotation |

type IfaceAnnTarget = AnnTarget OccName

data IfaceInst

Constructors

IfaceInst |

Fields

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

Instances

Outputable IfaceInst |
Binary IfaceInst |

data IfaceFamInst

Constructors

IfaceFamInst |

Fields

ifFamInstFam :: IfExtName
ifFamInstTys :: [Maybe IfaceTyCon]
ifFamInstTyCon :: IfaceTyCon

Instances

Outputable IfaceFamInst |
Binary IfaceFamInst |

data IfaceTickish

Constructors

IfaceHpcTick Module Int |
IfaceSCC CostCentre Bool Bool |

Instances

Binary IfaceTickish |

ifaceDeclSubBndrs :: IfaceDecl -> [OccName]

visibleIfConDecls :: IfaceConDecls -> [IfaceConDecl]

freeNamesIfDecl :: IfaceDecl -> NameSet

Finding the Names in IfaceSyn

freeNamesIfRule :: IfaceRule -> 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)

pprIfaceDeclHead :: IfaceContext -> OccName -> [IfaceTvBndr] -> SDoc