IfaceSyn

ghc-7.6.3: The GHC API

Safe Haskell | None

IfaceSyn

Synopsis

- module IfaceType
- data IfaceDecl
  - = IfaceId {
    - ifName :: OccName
    - ifType :: IfaceType
    - ifIdDetails :: IfaceIdDetails
    - ifIdInfo :: IfaceIdInfo
    }
  - | IfaceData {
    - ifName :: OccName
    - ifCType :: Maybe CType
    - ifTyVars :: [IfaceTvBndr]
    - ifCtxt :: IfaceContext
    - ifCons :: IfaceConDecls
    - ifRec :: RecFlag
    - ifGadtSyntax :: Bool
    - ifAxiom :: Maybe IfExtName
    }
  - | IfaceSyn {
    - ifName :: OccName
    - ifTyVars :: [IfaceTvBndr]
    - ifSynKind :: IfaceKind
    - ifSynRhs :: Maybe IfaceType
    }
  - | IfaceClass {
    - ifCtxt :: IfaceContext
    - ifName :: OccName
    - ifTyVars :: [IfaceTvBndr]
    - ifFDs :: [FunDep FastString]
    - ifATs :: [IfaceAT]
    - ifSigs :: [IfaceClassOp]
    - ifRec :: RecFlag
    }
  - | IfaceAxiom {
    - ifName :: OccName
    - ifTyVars :: [IfaceTvBndr]
    - ifLHS :: IfaceType
    - ifRHS :: IfaceType
    }
  - | 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
  - | IfDataFamTyCon
  - | 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]
  - | 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
  - | IfExtWrapper Arity IfExtName
  - | IfLclWrapper Arity IfLclName
  - | IfDFunUnfold [DFunArg 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 IfaceClsInst = IfaceClsInst {
  - ifInstCls :: IfExtName
  - ifInstTys :: [Maybe IfaceTyCon]
  - ifDFun :: IfExtName
  - ifOFlag :: OverlapFlag
  - ifInstOrph :: Maybe OccName
  }
- data IfaceFamInst = IfaceFamInst {
  - ifFamInstFam :: IfExtName
  - ifFamInstTys :: [Maybe IfaceTyCon]
  - ifFamInstAxiom :: IfExtName
  - ifFamInstOrph :: Maybe OccName
  }
- data IfaceTickish
  - = IfaceHpcTick Module Int
  - | IfaceSCC CostCentre Bool Bool
- 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
- 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 ifCType :: Maybe CType ifTyVars :: [IfaceTvBndr] ifCtxt :: IfaceContext ifCons :: IfaceConDecls ifRec :: RecFlag ifGadtSyntax :: Bool ifAxiom :: Maybe IfExtName
IfaceSyn |
Fields ifName :: OccName ifTyVars :: [IfaceTvBndr] ifSynKind :: IfaceKind ifSynRhs :: Maybe IfaceType
IfaceClass |
Fields ifCtxt :: IfaceContext ifName :: OccName ifTyVars :: [IfaceTvBndr] ifFDs :: [FunDep FastString] ifATs :: [IfaceAT] ifSigs :: [IfaceClassOp] ifRec :: RecFlag
IfaceAxiom |
Fields ifName :: OccName ifTyVars :: [IfaceTvBndr] ifLHS :: IfaceType ifRHS :: IfaceType
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 |
IfDataFamTyCon |
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] |
IfaceECase IfaceExpr IfaceType |
IfaceLet IfaceBinding IfaceExpr |
IfaceCast IfaceExpr IfaceCoercion |
IfaceLit Literal |
IfaceFCall ForeignCall IfaceType |
IfaceTick IfaceTickish IfaceExpr |

Instances

Outputable IfaceExpr |
Binary IfaceExpr |
Binary (DFunArg 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 |
IfExtWrapper Arity IfExtName |
IfLclWrapper Arity IfLclName |
IfDFunUnfold [DFunArg 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 IfaceClsInst

Constructors

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

Instances

Outputable IfaceClsInst |
Binary IfaceClsInst |

data IfaceFamInst

Constructors

IfaceFamInst |
Fields ifFamInstFam :: IfExtName ifFamInstTys :: [Maybe IfaceTyCon] ifFamInstAxiom :: IfExtName ifFamInstOrph :: Maybe OccName

Instances

Outputable IfaceFamInst |
Binary IfaceFamInst |

data IfaceTickish

Constructors

IfaceHpcTick Module Int |
IfaceSCC CostCentre Bool Bool |

Instances

Binary IfaceTickish |

ifaceDeclImplicitBndrs :: IfaceDecl -> [OccName]

visibleIfConDecls :: IfaceConDecls -> [IfaceConDecl]

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

freeNamesIfDecl :: IfaceDecl -> NameSet

Finding the Names in IfaceSyn

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)

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