Safe Haskell | None |
---|---|
Language | Haskell98 |
- data SimpleErrorMessage
- = ErrorParsingFFIModule FilePath
- | ErrorParsingModule ParseError
- | MissingFFIModule ModuleName
- | MultipleFFIModules ModuleName [FilePath]
- | UnnecessaryFFIModule ModuleName FilePath
- | CannotGetFileInfo FilePath
- | CannotReadFile FilePath
- | CannotWriteFile FilePath
- | InfiniteType Type
- | InfiniteKind Kind
- | MultipleFixities Ident
- | OrphanTypeDeclaration Ident
- | OrphanFixityDeclaration String
- | RedefinedModule ModuleName [SourceSpan]
- | RedefinedIdent Ident
- | OverlappingNamesInLet
- | UnknownModule ModuleName
- | UnknownType (Qualified (ProperName TypeName))
- | UnknownTypeClass (Qualified (ProperName ClassName))
- | UnknownValue (Qualified Ident)
- | UnknownDataConstructor (Qualified (ProperName ConstructorName)) (Maybe (Qualified (ProperName ConstructorName)))
- | UnknownTypeConstructor (Qualified (ProperName TypeName))
- | UnknownImportType ModuleName (ProperName TypeName)
- | UnknownExportType (ProperName TypeName)
- | UnknownImportTypeClass ModuleName (ProperName ClassName)
- | UnknownExportTypeClass (ProperName ClassName)
- | UnknownImportValue ModuleName Ident
- | UnknownExportValue Ident
- | UnknownExportModule ModuleName
- | UnknownImportDataConstructor ModuleName (ProperName TypeName) (ProperName ConstructorName)
- | UnknownExportDataConstructor (ProperName TypeName) (ProperName ConstructorName)
- | ScopeConflict String [ModuleName]
- | ScopeShadowing String (Maybe ModuleName) [ModuleName]
- | ConflictingTypeDecls (ProperName TypeName)
- | ConflictingCtorDecls (ProperName ConstructorName)
- | TypeConflictsWithClass (ProperName TypeName)
- | CtorConflictsWithClass (ProperName ConstructorName)
- | ClassConflictsWithType (ProperName ClassName)
- | ClassConflictsWithCtor (ProperName ClassName)
- | DuplicateModuleName ModuleName
- | DuplicateClassExport (ProperName ClassName)
- | DuplicateValueExport Ident
- | DuplicateTypeArgument String
- | InvalidDoBind
- | InvalidDoLet
- | CycleInDeclaration Ident
- | CycleInTypeSynonym (Maybe (ProperName TypeName))
- | CycleInModules [ModuleName]
- | NameIsUndefined Ident
- | UndefinedTypeVariable (ProperName TypeName)
- | PartiallyAppliedSynonym (Qualified (ProperName TypeName))
- | EscapedSkolem (Maybe Expr)
- | TypesDoNotUnify Type Type
- | KindsDoNotUnify Kind Kind
- | ConstrainedTypeUnified Type Type
- | OverlappingInstances (Qualified (ProperName ClassName)) [Type] [Qualified Ident]
- | NoInstanceFound (Qualified (ProperName ClassName)) [Type]
- | PossiblyInfiniteInstance (Qualified (ProperName ClassName)) [Type]
- | CannotDerive (Qualified (ProperName ClassName)) [Type]
- | CannotFindDerivingType (ProperName TypeName)
- | DuplicateLabel String (Maybe Expr)
- | DuplicateValueDeclaration Ident
- | ArgListLengthsDiffer Ident
- | OverlappingArgNames (Maybe Ident)
- | MissingClassMember Ident
- | ExtraneousClassMember Ident (Qualified (ProperName ClassName))
- | ExpectedType Type Kind
- | IncorrectConstructorArity (Qualified (ProperName ConstructorName))
- | ExprDoesNotHaveType Expr Type
- | PropertyIsMissing String
- | AdditionalProperty String
- | CannotApplyFunction Type Expr
- | TypeSynonymInstance
- | OrphanInstance Ident (Qualified (ProperName ClassName)) [Type]
- | InvalidNewtype (ProperName TypeName)
- | InvalidInstanceHead Type
- | TransitiveExportError DeclarationRef [DeclarationRef]
- | TransitiveDctorExportError DeclarationRef (ProperName ConstructorName)
- | ShadowedName Ident
- | ShadowedTypeVar String
- | UnusedTypeVar String
- | WildcardInferredType Type
- | MissingTypeDeclaration Ident Type
- | NotExhaustivePattern [[Binder]] Bool
- | OverlappingPattern [[Binder]] Bool
- | IncompleteExhaustivityCheck
- | ClassOperator (ProperName ClassName) Ident
- | MisleadingEmptyTypeImport ModuleName (ProperName TypeName)
- | ImportHidingModule ModuleName
- | UnusedImport ModuleName
- | UnusedExplicitImport ModuleName [String] (Maybe ModuleName) [DeclarationRef]
- | UnusedDctorImport (ProperName TypeName)
- | UnusedDctorExplicitImport (ProperName TypeName) [ProperName ConstructorName]
- | DeprecatedOperatorDecl String
- | DeprecatedOperatorSection Expr (Either Expr Expr)
- | DeprecatedQualifiedSyntax ModuleName ModuleName
- | DeprecatedClassImport ModuleName (ProperName ClassName)
- | DeprecatedClassExport (ProperName ClassName)
- | RedundantUnqualifiedImport ModuleName ImportDeclarationType
- | DuplicateSelectiveImport ModuleName
- | DuplicateImport ModuleName ImportDeclarationType (Maybe ModuleName)
- | DuplicateImportRef String
- | DuplicateExportRef String
- | IntOutOfRange Integer String Integer Integer
- | RedundantEmptyHidingImport ModuleName
- | ImplicitQualifiedImport ModuleName ModuleName [DeclarationRef]
- | ImplicitImport ModuleName [DeclarationRef]
- | HidingImport ModuleName [DeclarationRef]
- | CaseBinderLengthDiffers Int [Binder]
- | IncorrectAnonymousArgument
- | InvalidOperatorInBinder Ident Ident
- data ErrorMessageHint
- = ErrorUnifyingTypes Type Type
- | ErrorInExpression Expr
- | ErrorInModule ModuleName
- | ErrorInInstance (Qualified (ProperName ClassName)) [Type]
- | ErrorInSubsumption Type Type
- | ErrorCheckingAccessor Expr String
- | ErrorCheckingType Expr Type
- | ErrorCheckingKind Type
- | ErrorCheckingGuard
- | ErrorInferringType Expr
- | ErrorInApplication Expr Type Expr
- | ErrorInDataConstructor (ProperName ConstructorName)
- | ErrorInTypeConstructor (ProperName TypeName)
- | ErrorInBindingGroup [Ident]
- | ErrorInDataBindingGroup
- | ErrorInTypeSynonym (ProperName TypeName)
- | ErrorInValueDeclaration Ident
- | ErrorInTypeDeclaration Ident
- | ErrorInForeignImport Ident
- | PositionedError SourceSpan
- data HintCategory
- data ErrorMessage = ErrorMessage [ErrorMessageHint] SimpleErrorMessage
- newtype ErrorSuggestion = ErrorSuggestion String
- errorSpan :: ErrorMessage -> Maybe SourceSpan
- errorModule :: ErrorMessage -> Maybe ModuleName
- findHint :: (ErrorMessageHint -> Maybe a) -> ErrorMessage -> Maybe a
- stripModuleAndSpan :: ErrorMessage -> ErrorMessage
- errorCode :: ErrorMessage -> String
- newtype MultipleErrors = MultipleErrors {}
- nonEmpty :: MultipleErrors -> Bool
- errorMessage :: SimpleErrorMessage -> MultipleErrors
- singleError :: ErrorMessage -> MultipleErrors
- onErrorMessages :: (ErrorMessage -> ErrorMessage) -> MultipleErrors -> MultipleErrors
- addHint :: ErrorMessageHint -> MultipleErrors -> MultipleErrors
- data TypeMap = TypeMap {
- umSkolemMap :: Map Int (String, Int, Maybe SourceSpan)
- umNextSkolem :: Int
- umUnknownMap :: Map Int Int
- umNextUnknown :: Int
- defaultUnknownMap :: TypeMap
- data Level
- unwrapErrorMessage :: ErrorMessage -> SimpleErrorMessage
- replaceUnknowns :: Type -> State TypeMap Type
- onTypesInErrorMessageM :: Applicative m => (Type -> m Type) -> ErrorMessage -> m ErrorMessage
- wikiUri :: ErrorMessage -> String
- errorSuggestion :: SimpleErrorMessage -> Maybe ErrorSuggestion
- showSuggestion :: SimpleErrorMessage -> String
- prettyPrintSingleError :: Bool -> Level -> Bool -> ErrorMessage -> Box
- prettyPrintExport :: DeclarationRef -> String
- prettyPrintImport :: ModuleName -> ImportDeclarationType -> Maybe ModuleName -> String
- prettyPrintRef :: DeclarationRef -> String
- prettyPrintMultipleErrors :: Bool -> MultipleErrors -> String
- prettyPrintMultipleWarnings :: Bool -> MultipleErrors -> String
- prettyPrintMultipleWarningsBox :: Bool -> MultipleErrors -> Box
- prettyPrintMultipleErrorsBox :: Bool -> MultipleErrors -> Box
- prettyPrintMultipleErrorsWith :: Level -> String -> String -> Bool -> MultipleErrors -> Box
- prettyPrintParseError :: ParseError -> Box
- prettyPrintParseErrorMessages :: String -> String -> String -> String -> String -> [Message] -> Box
- indent :: Box -> Box
- line :: String -> Box
- renderBox :: Box -> String
- rethrow :: MonadError e m => (e -> e) -> m a -> m a
- reifyErrors :: (Functor m, MonadError e m) => m a -> m (Either e a)
- reflectErrors :: MonadError e m => m (Either e a) -> m a
- warnAndRethrow :: (MonadError e m, MonadWriter e m) => (e -> e) -> m a -> m a
- rethrowWithPosition :: MonadError MultipleErrors m => SourceSpan -> m a -> m a
- warnWithPosition :: MonadWriter MultipleErrors m => SourceSpan -> m a -> m a
- warnAndRethrowWithPosition :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => SourceSpan -> m a -> m a
- withPosition :: SourceSpan -> ErrorMessage -> ErrorMessage
- parU :: (MonadError MultipleErrors m, Functor m) => [a] -> (a -> m b) -> m [b]
Documentation
data SimpleErrorMessage Source
A type of error messages
data ErrorMessageHint Source
Error message hints, providing more detailed information about failure.
data HintCategory Source
Categories of hints
errorSpan :: ErrorMessage -> Maybe SourceSpan Source
Get the source span for an error
errorModule :: ErrorMessage -> Maybe ModuleName Source
Get the module name for an error
findHint :: (ErrorMessageHint -> Maybe a) -> ErrorMessage -> Maybe a Source
stripModuleAndSpan :: ErrorMessage -> ErrorMessage Source
Remove the module name and span hints from an error
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
addHint :: ErrorMessageHint -> MultipleErrors -> MultipleErrors Source
Add a hint to an error message
A map from rigid type variable name/unknown variable pairs to new variables.
TypeMap | |
|
unwrapErrorMessage :: ErrorMessage -> SimpleErrorMessage Source
Extract nested error messages from wrapper errors
onTypesInErrorMessageM :: Applicative m => (Type -> m Type) -> ErrorMessage -> m ErrorMessage Source
wikiUri :: ErrorMessage -> String Source
prettyPrintSingleError :: Bool -> Level -> Bool -> ErrorMessage -> 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
prettyPrintMultipleWarningsBox :: Bool -> MultipleErrors -> Box Source
Pretty print warnings as a Box
prettyPrintMultipleErrorsBox :: Bool -> MultipleErrors -> Box Source
Pretty print errors as a Box
prettyPrintMultipleErrorsWith :: Level -> String -> String -> Bool -> MultipleErrors -> Box Source
prettyPrintParseError :: ParseError -> Box Source
Pretty print a Parsec ParseError as a Box
prettyPrintParseErrorMessages :: String -> String -> String -> String -> String -> [Message] -> Box Source
Pretty print ParseError detail messages.
Adapted from showErrorMessages
, see https://github.com/aslatter/parsec/blob/v3.1.9/Text/Parsec/Error.hs#L173.
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
reifyErrors :: (Functor m, MonadError e m) => m a -> m (Either e a) Source
reflectErrors :: MonadError e m => m (Either e a) -> m a Source
warnAndRethrow :: (MonadError e m, MonadWriter e m) => (e -> e) -> m a -> m a Source
rethrowWithPosition :: MonadError MultipleErrors m => SourceSpan -> m a -> m a Source
Rethrow an error with source position information
warnWithPosition :: MonadWriter MultipleErrors m => SourceSpan -> m a -> m a Source
warnAndRethrowWithPosition :: (MonadError MultipleErrors m, MonadWriter MultipleErrors m) => SourceSpan -> m a -> m a Source
withPosition :: SourceSpan -> ErrorMessage -> ErrorMessage Source
parU :: (MonadError MultipleErrors m, Functor m) => [a] -> (a -> m b) -> m [b] Source
Collect errors in in parallel