Safe Haskell | None |
---|---|
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
- | ResSigCtxt
- | ForSigCtxt Name
- | DefaultDeclCtxt
- | InstDeclCtxt Bool
- | SpecInstCtxt
- | ThBrackCtxt
- | 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 SDoc
- | DerivSkol Type
- | InstSkol
- | InstSC TypeSize
- | 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
- | OccurrenceOf Name
- | OccurrenceOfRecSel RdrName
- | AppOrigin
- | SpecPragOrigin UserTypeCtxt
- | TypeEqOrigin {
- uo_actual :: TcType
- uo_expected :: TcType
- uo_thing :: Maybe SDoc
- uo_visible :: Bool
- | KindEqOrigin TcType (Maybe TcType) CtOrigin (Maybe TypeOrKind)
- | IPOccOrigin HsIPName
- | OverLabelOrigin FastString
- | LiteralOrigin (HsOverLit GhcRn)
- | NegateOrigin
- | ArithSeqOrigin (ArithSeqInfo GhcRn)
- | AssocFamPatOrigin
- | SectionOrigin
- | 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
- | UnboundOccurrenceOf OccName
- | ListOrigin
- | BracketOrigin
- | StaticOrigin
- | Shouldn'tHappenOrigin String
- | InstProvidedOrigin Module ClsInst
- | NonLinearPatternOrigin
- | UsageEnvironmentOf Name
- 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 |
pprSigSkolInfo :: UserTypeCtxt -> TcType -> SDoc Source #
pprSkolInfo :: SkolemInfo -> SDoc Source #
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 #