Safe Haskell | None |
---|---|
Language | Haskell98 |
- data SimpleErrorMessage
- = ErrorParsingExterns ParseError
- | ErrorParsingFFIModule FilePath
- | ErrorParsingModule ParseError
- | MissingFFIModule ModuleName
- | MultipleFFIModules ModuleName [FilePath]
- | UnnecessaryFFIModule ModuleName FilePath
- | InvalidExternsFile FilePath
- | CannotGetFileInfo FilePath
- | CannotReadFile FilePath
- | CannotWriteFile FilePath
- | InfiniteType Type
- | InfiniteKind Kind
- | CannotReorderOperators
- | MultipleFixities Ident
- | OrphanTypeDeclaration Ident
- | OrphanFixityDeclaration String
- | RedefinedModule ModuleName
- | RedefinedIdent Ident
- | OverlappingNamesInLet
- | UnknownModule ModuleName
- | UnknownType (Qualified ProperName)
- | UnknownTypeClass (Qualified ProperName)
- | UnknownValue (Qualified Ident)
- | UnknownDataConstructor (Qualified ProperName) (Maybe (Qualified ProperName))
- | UnknownTypeConstructor (Qualified ProperName)
- | ConflictingImport String ModuleName
- | ConflictingImports String ModuleName ModuleName
- | ConflictingTypeDecls ProperName
- | ConflictingCtorDecls ProperName
- | TypeConflictsWithClass ProperName
- | CtorConflictsWithClass ProperName
- | ClassConflictsWithType ProperName
- | ClassConflictsWithCtor ProperName
- | DuplicateClassExport ProperName
- | DuplicateValueExport Ident
- | DuplicateTypeArgument String
- | InvalidDoBind
- | InvalidDoLet
- | CycleInDeclaration Ident
- | CycleInTypeSynonym (Maybe ProperName)
- | CycleInModules [ModuleName]
- | NameIsUndefined Ident
- | NameNotInScope Ident
- | UndefinedTypeVariable ProperName
- | PartiallyAppliedSynonym (Qualified ProperName)
- | EscapedSkolem (Maybe Expr)
- | UnspecifiedSkolemScope
- | TypesDoNotUnify Type Type
- | KindsDoNotUnify Kind Kind
- | ConstrainedTypeUnified Type Type
- | OverlappingInstances (Qualified ProperName) [Type] [DictionaryValue]
- | NoInstanceFound (Qualified ProperName) [Type]
- | DuplicateLabel String (Maybe Expr)
- | DuplicateValueDeclaration Ident
- | ArgListLengthsDiffer Ident
- | OverlappingArgNames (Maybe Ident)
- | MissingClassMember Ident
- | ExtraneousClassMember Ident
- | ExpectedType Kind
- | IncorrectConstructorArity (Qualified ProperName)
- | SubsumptionCheckFailed
- | ExprDoesNotHaveType Expr Type
- | PropertyIsMissing String Type
- | CannotApplyFunction Type Expr
- | TypeSynonymInstance
- | InvalidNewtype
- | InvalidInstanceHead Type
- | TransitiveExportError DeclarationRef [DeclarationRef]
- | ShadowedName Ident
- | WildcardInferredType Type
- | NotExhaustivePattern [[Binder]] Bool
- | OverlappingPattern [[Binder]] Bool
- | ClassOperator ProperName Ident
- data ErrorMessage
- = NotYetDefined [Ident] ErrorMessage
- | ErrorUnifyingTypes Type Type ErrorMessage
- | ErrorInExpression Expr ErrorMessage
- | ErrorInModule ModuleName ErrorMessage
- | ErrorInInstance (Qualified ProperName) [Type] ErrorMessage
- | ErrorInSubsumption Type Type ErrorMessage
- | ErrorCheckingType Expr Type ErrorMessage
- | ErrorCheckingKind Type ErrorMessage
- | ErrorInferringType Expr ErrorMessage
- | ErrorInApplication Expr Type Expr ErrorMessage
- | ErrorInDataConstructor ProperName ErrorMessage
- | ErrorInTypeConstructor ProperName ErrorMessage
- | ErrorInBindingGroup [Ident] ErrorMessage
- | ErrorInDataBindingGroup ErrorMessage
- | ErrorInTypeSynonym ProperName ErrorMessage
- | ErrorInValueDeclaration Ident ErrorMessage
- | ErrorInForeignImport Ident ErrorMessage
- | PositionedError SourceSpan ErrorMessage
- | SimpleErrorWrapper SimpleErrorMessage
- errorCode :: ErrorMessage -> String
- newtype MultipleErrors = MultipleErrors {}
- nonEmpty :: MultipleErrors -> Bool
- errorMessage :: SimpleErrorMessage -> MultipleErrors
- singleError :: ErrorMessage -> MultipleErrors
- onErrorMessages :: (ErrorMessage -> ErrorMessage) -> MultipleErrors -> MultipleErrors
- data LabelType
- type UnknownMap = Map (LabelType, Unknown) Unknown
- data Level
- unwrapErrorMessage :: ErrorMessage -> SimpleErrorMessage
- replaceUnknowns :: Type -> State UnknownMap Type
- onTypesInErrorMessageM :: Applicative m => (Type -> m Type) -> ErrorMessage -> m ErrorMessage
- prettyPrintSingleError :: Bool -> Level -> ErrorMessage -> State UnknownMap Box
- prettyPrintMultipleErrors :: Bool -> MultipleErrors -> String
- prettyPrintMultipleWarnings :: Bool -> MultipleErrors -> String
- prettyPrintMultipleErrorsWith :: Level -> String -> String -> Bool -> MultipleErrors -> State UnknownMap String
- renderBox :: Box -> String
- interpretMultipleErrorsAndWarnings :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => (Either MultipleErrors a, MultipleErrors) -> m a
- rethrow :: MonadError e m => (e -> e) -> m a -> m a
- rethrowWithPosition :: MonadError MultipleErrors m => SourceSpan -> m a -> m a
- parU :: (MonadError MultipleErrors m, Functor m) => [a] -> (a -> m b) -> m [b]
Documentation
data SimpleErrorMessage Source
A type of error messages
data ErrorMessage Source
Wrapper of simpler errors
errorCode :: ErrorMessage -> String Source
Get the error code for a particular error type
newtype MultipleErrors Source
A stack trace for an error
nonEmpty :: MultipleErrors -> Bool Source
Check whether a collection of errors is empty or not.
errorMessage :: SimpleErrorMessage -> MultipleErrors Source
Create an error set from a single simple error message
singleError :: ErrorMessage -> MultipleErrors Source
Create an error set from a single error message
onErrorMessages :: (ErrorMessage -> ErrorMessage) -> MultipleErrors -> MultipleErrors Source
Lift a function on ErrorMessage to a function on MultipleErrors
The various types of things which might need to be relabelled in errors messages.
type UnknownMap = Map (LabelType, Unknown) Unknown Source
A map from rigid type variable name/unknown variable pairs to new variables.
unwrapErrorMessage :: ErrorMessage -> SimpleErrorMessage Source
Extract nested error messages from wrapper errors
replaceUnknowns :: Type -> State UnknownMap Type Source
onTypesInErrorMessageM :: Applicative m => (Type -> m Type) -> ErrorMessage -> m ErrorMessage Source
prettyPrintSingleError :: Bool -> Level -> ErrorMessage -> State UnknownMap Box Source
Pretty print a single error, simplifying if necessary
prettyPrintMultipleErrors :: Bool -> MultipleErrors -> String Source
Pretty print multiple errors
prettyPrintMultipleWarnings :: Bool -> MultipleErrors -> String Source
Pretty print multiple warnings
prettyPrintMultipleErrorsWith :: Level -> String -> String -> Bool -> MultipleErrors -> State UnknownMap String Source
interpretMultipleErrorsAndWarnings :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => (Either MultipleErrors a, MultipleErrors) -> m a Source
Interpret multiple errors and warnings in a monad supporting errors and warnings
rethrow :: MonadError e m => (e -> e) -> m a -> m a Source
Rethrow an error with a more detailed error message in the case of failure
rethrowWithPosition :: MonadError MultipleErrors m => SourceSpan -> m a -> m a Source
Rethrow an error with source position information
parU :: (MonadError MultipleErrors m, Functor m) => [a] -> (a -> m b) -> m [b] Source
Collect errors in in parallel