ghc-6.12.3: The GHC APISource codeContentsIndex
HsBinds
Synopsis
type HsLocalBinds id = HsLocalBindsLR id id
data HsLocalBindsLR idL idR
= HsValBinds (HsValBindsLR idL idR)
| HsIPBinds (HsIPBinds idR)
| EmptyLocalBinds
type HsValBinds id = HsValBindsLR id id
data HsValBindsLR idL idR
= ValBindsIn (LHsBindsLR idL idR) [LSig idR]
| ValBindsOut [(RecFlag, LHsBinds idL)] [LSig Name]
type LHsBinds id = Bag (LHsBind id)
type DictBinds id = LHsBinds id
type LHsBind id = Located (HsBind id)
type HsBind id = HsBindLR id id
type LHsBindLR idL idR = Located (HsBindLR idL idR)
type LHsBindsLR idL idR = Bag (LHsBindLR idL idR)
data HsBindLR idL idR
= FunBind {
fun_id :: Located idL
fun_infix :: Bool
fun_matches :: MatchGroup idR
fun_co_fn :: HsWrapper
bind_fvs :: NameSet
fun_tick :: Maybe (Int, [idR])
}
| PatBind {
pat_lhs :: LPat idL
pat_rhs :: GRHSs idR
pat_rhs_ty :: PostTcType
bind_fvs :: NameSet
}
| VarBind {
var_id :: idL
var_rhs :: LHsExpr idR
}
| AbsBinds {
abs_tvs :: [TyVar]
abs_dicts :: [DictId]
abs_exports :: [([TyVar], idL, idL, [LPrag])]
abs_binds :: LHsBinds idL
}
placeHolderNames :: NameSet
pprValBindsForUser :: (OutputableBndr idL, OutputableBndr idR, OutputableBndr id2) => LHsBindsLR idL idR -> [LSig id2] -> SDoc
pprLHsBinds :: (OutputableBndr idL, OutputableBndr idR) => LHsBindsLR idL idR -> SDoc
emptyLocalBinds :: HsLocalBindsLR a b
isEmptyLocalBinds :: HsLocalBindsLR a b -> Bool
isEmptyValBinds :: HsValBindsLR a b -> Bool
emptyValBindsOut :: HsValBindsLR a b
emptyValBindsIn :: HsValBindsLR a b
emptyLHsBinds :: LHsBindsLR idL idR
isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool
plusHsValBinds :: HsValBinds a -> HsValBinds a -> HsValBinds a
ppr_monobind :: (OutputableBndr idL, OutputableBndr idR) => HsBindLR idL idR -> SDoc
pprTicks :: SDoc -> SDoc -> SDoc
data HsIPBinds id = IPBinds [LIPBind id] (DictBinds id)
isEmptyIPBinds :: HsIPBinds id -> Bool
type LIPBind id = Located (IPBind id)
data IPBind id = IPBind (IPName id) (LHsExpr id)
data HsWrapper
= WpHole
| WpCompose HsWrapper HsWrapper
| WpCast Coercion
| WpApp Var
| WpTyApp Type
| WpLam Var
| WpTyLam TyVar
| WpInline
| WpLet (LHsBinds Id)
pprHsWrapper :: SDoc -> HsWrapper -> SDoc
(<.>) :: HsWrapper -> HsWrapper -> HsWrapper
mkWpTyApps :: [Type] -> HsWrapper
mkWpApps :: [Var] -> HsWrapper
mkWpTyLams :: [TyVar] -> HsWrapper
mkWpLams :: [Var] -> HsWrapper
mk_co_fn :: (a -> HsWrapper) -> [a] -> HsWrapper
idHsWrapper :: HsWrapper
isIdHsWrapper :: HsWrapper -> Bool
type LSig name = Located (Sig name)
data Sig name
= TypeSig (Located name) (LHsType name)
| IdSig Id
| FixSig (FixitySig name)
| InlineSig (Located name) InlineSpec
| SpecSig (Located name) (LHsType name) InlineSpec
| SpecInstSig (LHsType name)
type LFixitySig name = Located (FixitySig name)
data FixitySig name = FixitySig (Located name) Fixity
type LPrag = Located Prag
data Prag
= InlinePrag InlineSpec
| SpecPrag (HsExpr Id) PostTcType InlineSpec
isInlinePrag :: Prag -> Bool
isSpecPrag :: Prag -> Bool
okBindSig :: Sig a -> Bool
okHsBootSig :: Sig a -> Bool
okClsDclSig :: Sig a -> Bool
okInstDclSig :: Sig a -> Bool
sigForThisGroup :: NameSet -> LSig Name -> Bool
sigName :: LSig name -> Maybe name
sigNameNoLoc :: Sig name -> Maybe name
isFixityLSig :: LSig name -> Bool
isVanillaLSig :: LSig name -> Bool
isTypeLSig :: LSig name -> Bool
isSpecLSig :: LSig name -> Bool
isSpecInstLSig :: LSig name -> Bool
isPragLSig :: LSig name -> Bool
isInlineLSig :: LSig name -> Bool
hsSigDoc :: Sig name -> SDoc
eqHsSig :: Eq a => LSig a -> LSig a -> Bool
ppr_sig :: OutputableBndr name => Sig name -> SDoc
pragBrackets :: SDoc -> SDoc
pprVarSig :: (Outputable id, Outputable ty) => id -> ty -> SDoc
pprSpec :: (Outputable id, Outputable ty) => id -> ty -> InlineSpec -> SDoc
pprPrag :: Outputable id => id -> LPrag -> SDoc
Documentation
type HsLocalBinds id = HsLocalBindsLR id idSource
data HsLocalBindsLR idL idR Source
Constructors
HsValBinds (HsValBindsLR idL idR)
HsIPBinds (HsIPBinds idR)
EmptyLocalBinds
show/hide Instances
type HsValBinds id = HsValBindsLR id idSource
data HsValBindsLR idL idR Source
Constructors
ValBindsIn (LHsBindsLR idL idR) [LSig idR]
ValBindsOut [(RecFlag, LHsBinds idL)] [LSig Name]
show/hide Instances
type LHsBinds id = Bag (LHsBind id)Source
type DictBinds id = LHsBinds idSource
type LHsBind id = Located (HsBind id)Source
type HsBind id = HsBindLR id idSource
type LHsBindLR idL idR = Located (HsBindLR idL idR)Source
type LHsBindsLR idL idR = Bag (LHsBindLR idL idR)Source
data HsBindLR idL idR Source
Constructors
FunBind

FunBind is used for both functions f x = e and variables f = x -> e

Reason 1: Special case for type inference: see TcBinds.tcMonoBinds.

Reason 2: Instance decls can only have FunBinds, which is convenient. If you change this, you'll need to change e.g. rnMethodBinds

But note that the form f :: a->a = ... parses as a pattern binding, just like (f :: a -> a) = ...

fun_id :: Located idL
fun_infix :: BoolTrue => infix declaration
fun_matches :: MatchGroup idRThe payload
fun_co_fn :: HsWrapperCoercion from the type of the MatchGroup to the type of the Id. Example: f :: Int -> forall a. a -> a f x y = y Then the MatchGroup will have type (Int -> a' -> a') (with a free type variable a'). The coercion will take a CoreExpr of this type and convert it to a CoreExpr of type Int -> forall a'. a' -> a' Notice that the coercion captures the free a'.
bind_fvs :: NameSetAfter the renamer, this contains a superset of the Names of the other binders in this binding group that are free in the RHS of the defn Before renaming, and after typechecking, the field is unused; it's just an error thunk
fun_tick :: Maybe (Int, [idR])This is the (optional) module-local tick number.
PatBind
pat_lhs :: LPat idL
pat_rhs :: GRHSs idR
pat_rhs_ty :: PostTcType
bind_fvs :: NameSetAfter the renamer, this contains a superset of the Names of the other binders in this binding group that are free in the RHS of the defn Before renaming, and after typechecking, the field is unused; it's just an error thunk
VarBind
var_id :: idL
var_rhs :: LHsExpr idR
AbsBinds
abs_tvs :: [TyVar]
abs_dicts :: [DictId]
abs_exports :: [([TyVar], idL, idL, [LPrag])]
abs_binds :: LHsBinds idL
show/hide Instances
placeHolderNames :: NameSetSource
pprValBindsForUser :: (OutputableBndr idL, OutputableBndr idR, OutputableBndr id2) => LHsBindsLR idL idR -> [LSig id2] -> SDocSource
pprLHsBinds :: (OutputableBndr idL, OutputableBndr idR) => LHsBindsLR idL idR -> SDocSource
emptyLocalBinds :: HsLocalBindsLR a bSource
isEmptyLocalBinds :: HsLocalBindsLR a b -> BoolSource
isEmptyValBinds :: HsValBindsLR a b -> BoolSource
emptyValBindsOut :: HsValBindsLR a bSource
emptyValBindsIn :: HsValBindsLR a bSource
emptyLHsBinds :: LHsBindsLR idL idRSource
isEmptyLHsBinds :: LHsBindsLR idL idR -> BoolSource
plusHsValBinds :: HsValBinds a -> HsValBinds a -> HsValBinds aSource
ppr_monobind :: (OutputableBndr idL, OutputableBndr idR) => HsBindLR idL idR -> SDocSource
pprTicks :: SDoc -> SDoc -> SDocSource
data HsIPBinds id Source
Constructors
IPBinds [LIPBind id] (DictBinds id)
show/hide Instances
isEmptyIPBinds :: HsIPBinds id -> BoolSource
type LIPBind id = Located (IPBind id)Source
data IPBind id Source
Implicit parameter bindings.
Constructors
IPBind (IPName id) (LHsExpr id)
show/hide Instances
data HsWrapper Source
Constructors
WpHole
WpCompose HsWrapper HsWrapper
WpCast Coercion
WpApp Var
WpTyApp Type
WpLam Var
WpTyLam TyVar
WpInline
WpLet (LHsBinds Id)
show/hide Instances
pprHsWrapper :: SDoc -> HsWrapper -> SDocSource
(<.>) :: HsWrapper -> HsWrapper -> HsWrapperSource
mkWpTyApps :: [Type] -> HsWrapperSource
mkWpApps :: [Var] -> HsWrapperSource
mkWpTyLams :: [TyVar] -> HsWrapperSource
mkWpLams :: [Var] -> HsWrapperSource
mk_co_fn :: (a -> HsWrapper) -> [a] -> HsWrapperSource
idHsWrapper :: HsWrapperSource
isIdHsWrapper :: HsWrapper -> BoolSource
type LSig name = Located (Sig name)Source
data Sig name Source
Constructors
TypeSig (Located name) (LHsType name)
IdSig Id
FixSig (FixitySig name)
InlineSig (Located name) InlineSpec
SpecSig (Located name) (LHsType name) InlineSpec
SpecInstSig (LHsType name)
show/hide Instances
type LFixitySig name = Located (FixitySig name)Source
data FixitySig name Source
Constructors
FixitySig (Located name) Fixity
show/hide Instances
type LPrag = Located PragSource
data Prag Source
Constructors
InlinePrag InlineSpec
SpecPrag (HsExpr Id) PostTcType InlineSpec
isInlinePrag :: Prag -> BoolSource
isSpecPrag :: Prag -> BoolSource
okBindSig :: Sig a -> BoolSource
okHsBootSig :: Sig a -> BoolSource
okClsDclSig :: Sig a -> BoolSource
okInstDclSig :: Sig a -> BoolSource
sigForThisGroup :: NameSet -> LSig Name -> BoolSource
sigName :: LSig name -> Maybe nameSource
sigNameNoLoc :: Sig name -> Maybe nameSource
isFixityLSig :: LSig name -> BoolSource
isVanillaLSig :: LSig name -> BoolSource
isTypeLSig :: LSig name -> BoolSource
isSpecLSig :: LSig name -> BoolSource
isSpecInstLSig :: LSig name -> BoolSource
isPragLSig :: LSig name -> BoolSource
isInlineLSig :: LSig name -> BoolSource
hsSigDoc :: Sig name -> SDocSource
eqHsSig :: Eq a => LSig a -> LSig a -> BoolSource
ppr_sig :: OutputableBndr name => Sig name -> SDocSource
pragBrackets :: SDoc -> SDocSource
pprVarSig :: (Outputable id, Outputable ty) => id -> ty -> SDocSource
pprSpec :: (Outputable id, Outputable ty) => id -> ty -> InlineSpec -> SDocSource
pprPrag :: Outputable id => id -> LPrag -> SDocSource
Produced by Haddock version 2.6.1