Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Describes the provenance of types as they flow through the type-checker. The datatypes here are mainly used for error message generation.
Synopsis
- data UserTypeCtxt
- = FunSigCtxt Name Bool
- | InfSigCtxt Name
- | ExprSigCtxt
- | KindSigCtxt
- | StandaloneKindSigCtxt Name
- | TypeAppCtxt
- | ConArgCtxt Name
- | TySynCtxt Name
- | PatSynCtxt Name
- | PatSigCtxt
- | RuleSigCtxt Name
- | ForSigCtxt Name
- | DefaultDeclCtxt
- | InstDeclCtxt Bool
- | SpecInstCtxt
- | GenSigCtxt
- | GhciCtxt Bool
- | ClassSCCtxt Name
- | SigmaCtxt
- | DataTyCtxt Name
- | DerivClauseCtxt
- | TyVarBndrKindCtxt Name
- | DataKindCtxt Name
- | TySynKindCtxt Name
- | TyFamResKindCtxt Name
- pprUserTypeCtxt :: UserTypeCtxt -> SDoc
- isSigMaybe :: UserTypeCtxt -> Maybe Name
- data SkolemInfo
- = SigSkol UserTypeCtxt TcType [(Name, TcTyVar)]
- | SigTypeSkol UserTypeCtxt
- | ForAllSkol SDoc
- | DerivSkol Type
- | InstSkol
- | FamInstSkol
- | PatSkol ConLike (HsMatchContext GhcRn)
- | ArrowSkol
- | IPSkol [HsIPName]
- | RuleSkol RuleName
- | InferSkol [(Name, TcType)]
- | BracketSkol
- | UnifyForAllSkol TcType
- | TyConSkol TyConFlavour Name
- | DataConSkol Name
- | ReifySkol
- | QuantCtxtSkol
- | RuntimeUnkSkol
- | UnkSkol
- pprSigSkolInfo :: UserTypeCtxt -> TcType -> SDoc
- pprSkolInfo :: SkolemInfo -> SDoc
- data CtOrigin
- = GivenOrigin SkolemInfo
- | InstSCOrigin ScDepth TypeSize
- | OtherSCOrigin ScDepth SkolemInfo
- | OccurrenceOf Name
- | OccurrenceOfRecSel RdrName
- | AppOrigin
- | SpecPragOrigin UserTypeCtxt
- | TypeEqOrigin {
- uo_actual :: TcType
- uo_expected :: TcType
- uo_thing :: Maybe SDoc
- uo_visible :: Bool
- | KindEqOrigin TcType TcType CtOrigin (Maybe TypeOrKind)
- | IPOccOrigin HsIPName
- | OverLabelOrigin FastString
- | LiteralOrigin (HsOverLit GhcRn)
- | NegateOrigin
- | ArithSeqOrigin (ArithSeqInfo GhcRn)
- | AssocFamPatOrigin
- | SectionOrigin
- | HasFieldOrigin FastString
- | TupleOrigin
- | ExprSigOrigin
- | PatSigOrigin
- | PatOrigin
- | ProvCtxtOrigin (PatSynBind GhcRn GhcRn)
- | RecordUpdOrigin
- | ViewPatOrigin
- | ScOrigin TypeSize
- | DerivClauseOrigin
- | DerivOriginDC DataCon Int Bool
- | DerivOriginCoerce Id Type Type Bool
- | StandAloneDerivOrigin
- | DefaultOrigin
- | DoOrigin
- | DoPatOrigin (LPat GhcRn)
- | MCompOrigin
- | MCompPatOrigin (LPat GhcRn)
- | IfOrigin
- | ProcOrigin
- | AnnOrigin
- | FunDepOrigin1 PredType CtOrigin RealSrcSpan PredType CtOrigin RealSrcSpan
- | FunDepOrigin2 PredType CtOrigin PredType SrcSpan
- | ExprHoleOrigin OccName
- | TypeHoleOrigin OccName
- | PatCheckOrigin
- | ListOrigin
- | BracketOrigin
- | StaticOrigin
- | Shouldn'tHappenOrigin String
- | InstProvidedOrigin Module ClsInst
- | NonLinearPatternOrigin
- | UsageEnvironmentOf Name
- | CycleBreakerOrigin CtOrigin
- exprCtOrigin :: HsExpr GhcRn -> CtOrigin
- lexprCtOrigin :: LHsExpr GhcRn -> CtOrigin
- matchesCtOrigin :: MatchGroup GhcRn (LHsExpr GhcRn) -> CtOrigin
- grhssCtOrigin :: GRHSs GhcRn (LHsExpr GhcRn) -> CtOrigin
- isVisibleOrigin :: CtOrigin -> Bool
- toInvisibleOrigin :: CtOrigin -> CtOrigin
- pprCtOrigin :: CtOrigin -> SDoc
- isGivenOrigin :: CtOrigin -> Bool
Documentation
data UserTypeCtxt Source #
UserTypeCtxt describes the origin of the polymorphic type in the places where we need an expression to have that type
pprUserTypeCtxt :: UserTypeCtxt -> SDoc Source #
isSigMaybe :: UserTypeCtxt -> Maybe Name Source #
data SkolemInfo Source #
Instances
Outputable SkolemInfo Source # | |
Defined in GHC.Tc.Types.Origin ppr :: SkolemInfo -> SDoc Source # |
pprSigSkolInfo :: UserTypeCtxt -> TcType -> SDoc Source #
pprSkolInfo :: SkolemInfo -> SDoc Source #
GivenOrigin SkolemInfo | A given constraint from a user-written type signature. The
|
InstSCOrigin |
|
| |
OtherSCOrigin |
|
| |
OccurrenceOf Name | |
OccurrenceOfRecSel RdrName | |
AppOrigin | |
SpecPragOrigin UserTypeCtxt | |
TypeEqOrigin | |
| |
KindEqOrigin TcType TcType CtOrigin (Maybe TypeOrKind) | |
IPOccOrigin HsIPName | |
OverLabelOrigin FastString | |
LiteralOrigin (HsOverLit GhcRn) | |
NegateOrigin | |
ArithSeqOrigin (ArithSeqInfo GhcRn) | |
AssocFamPatOrigin | |
SectionOrigin | |
HasFieldOrigin FastString | |
TupleOrigin | |
ExprSigOrigin | |
PatSigOrigin | |
PatOrigin | |
ProvCtxtOrigin (PatSynBind GhcRn GhcRn) | |
RecordUpdOrigin | |
ViewPatOrigin | |
ScOrigin TypeSize |
|
DerivClauseOrigin | |
DerivOriginDC DataCon Int Bool | |
DerivOriginCoerce Id Type Type Bool | |
StandAloneDerivOrigin | |
DefaultOrigin | |
DoOrigin | |
DoPatOrigin (LPat GhcRn) | |
MCompOrigin | |
MCompPatOrigin (LPat GhcRn) | |
IfOrigin | |
ProcOrigin | |
AnnOrigin | |
FunDepOrigin1 PredType CtOrigin RealSrcSpan PredType CtOrigin RealSrcSpan | |
FunDepOrigin2 PredType CtOrigin PredType SrcSpan | |
ExprHoleOrigin OccName | |
TypeHoleOrigin OccName | |
PatCheckOrigin | |
ListOrigin | |
BracketOrigin | |
StaticOrigin | |
Shouldn'tHappenOrigin String | |
InstProvidedOrigin Module ClsInst | |
NonLinearPatternOrigin | |
UsageEnvironmentOf Name | |
CycleBreakerOrigin CtOrigin |
Instances
matchesCtOrigin :: MatchGroup GhcRn (LHsExpr GhcRn) -> CtOrigin Source #
Extract a suitable CtOrigin from a MatchGroup
grhssCtOrigin :: GRHSs GhcRn (LHsExpr GhcRn) -> CtOrigin Source #
Extract a suitable CtOrigin from guarded RHSs
isVisibleOrigin :: CtOrigin -> Bool Source #
toInvisibleOrigin :: CtOrigin -> CtOrigin Source #
pprCtOrigin :: CtOrigin -> SDoc Source #
isGivenOrigin :: CtOrigin -> Bool Source #