| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Language.PureScript.Errors
- data SimpleErrorMessage
- = ErrorParsingFFIModule FilePath (Maybe ErrorMessage)
- | ErrorParsingModule ParseError
- | MissingFFIModule ModuleName
- | MultipleFFIModules ModuleName [FilePath]
- | UnnecessaryFFIModule ModuleName FilePath
- | MissingFFIImplementations ModuleName [Ident]
- | UnusedFFIImplementations ModuleName [Ident]
- | InvalidFFIIdentifier ModuleName String
- | CannotGetFileInfo FilePath
- | CannotReadFile FilePath
- | CannotWriteFile FilePath
- | InfiniteType Type
- | InfiniteKind Kind
- | MultipleValueOpFixities (OpName ValueOpName)
- | MultipleTypeOpFixities (OpName TypeOpName)
- | OrphanTypeDeclaration Ident
- | RedefinedModule ModuleName [SourceSpan]
- | RedefinedIdent Ident
- | OverlappingNamesInLet
- | UnknownName (Qualified Name)
- | UnknownImport ModuleName Name
- | UnknownImportDataConstructor ModuleName (ProperName TypeName) (ProperName ConstructorName)
- | UnknownExport Name
- | UnknownExportDataConstructor (ProperName TypeName) (ProperName ConstructorName)
- | ScopeConflict Name [ModuleName]
- | ScopeShadowing Name (Maybe ModuleName) [ModuleName]
- | DeclConflict Name Name
- | ExportConflict (Qualified Name) (Qualified Name)
- | DuplicateModuleName ModuleName
- | 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 Constraint
- | 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
- | HoleInferredType String Type [(Ident, Type)]
- | MissingTypeDeclaration Ident Type
- | OverlappingPattern [[Binder]] Bool
- | IncompleteExhaustivityCheck
- | MisleadingEmptyTypeImport ModuleName (ProperName TypeName)
- | ImportHidingModule ModuleName
- | UnusedImport ModuleName
- | UnusedExplicitImport ModuleName [String] (Maybe ModuleName) [DeclarationRef]
- | UnusedDctorImport (ProperName TypeName)
- | UnusedDctorExplicitImport (ProperName TypeName) [ProperName ConstructorName]
- | DuplicateSelectiveImport ModuleName
- | DuplicateImport ModuleName ImportDeclarationType (Maybe ModuleName)
- | DuplicateImportRef Name
- | DuplicateExportRef Name
- | IntOutOfRange Integer String Integer Integer
- | ImplicitQualifiedImport ModuleName ModuleName [DeclarationRef]
- | ImplicitImport ModuleName [DeclarationRef]
- | HidingImport ModuleName [DeclarationRef]
- | CaseBinderLengthDiffers Int [Binder]
- | IncorrectAnonymousArgument
- | InvalidOperatorInBinder (Qualified (OpName ValueOpName)) (Qualified Ident)
- | DeprecatedRequirePath
- | CannotGeneralizeRecursiveFunction Ident Type
- 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)
- umUnknownMap :: Map Int Int
- umNextIndex :: 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
- suggestionSpan :: ErrorMessage -> Maybe SourceSpan
- showSuggestion :: SimpleErrorMessage -> String
- ansiColor :: (ColorIntensity, Color) -> String
- ansiColorReset :: String
- colorCode :: Maybe (ColorIntensity, Color) -> String -> String
- colorCodeBox :: Maybe (ColorIntensity, Color) -> Box -> Box
- defaultCodeColor :: (ColorIntensity, Color)
- data PPEOptions = PPEOptions {
- ppeCodeColor :: Maybe (ColorIntensity, Color)
- ppeFull :: Bool
- ppeLevel :: Level
- ppeShowWiki :: Bool
- defaultPPEOptions :: PPEOptions
- prettyPrintSingleError :: PPEOptions -> ErrorMessage -> Box
- prettyPrintExport :: DeclarationRef -> String
- prettyPrintImport :: ModuleName -> ImportDeclarationType -> Maybe ModuleName -> String
- prettyPrintRef :: DeclarationRef -> String
- prettyPrintMultipleErrors :: PPEOptions -> MultipleErrors -> String
- prettyPrintMultipleWarnings :: PPEOptions -> MultipleErrors -> String
- prettyPrintMultipleWarningsBox :: PPEOptions -> MultipleErrors -> [Box]
- prettyPrintMultipleErrorsBox :: PPEOptions -> MultipleErrors -> [Box]
- prettyPrintMultipleErrorsWith :: PPEOptions -> String -> String -> 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 :: 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
- escalateWarningWhen :: (MonadWriter MultipleErrors m, MonadError MultipleErrors m) => (ErrorMessage -> Bool) -> m a -> m a
- parU :: MonadError MultipleErrors m => [a] -> (a -> m b) -> m [b]
Documentation
data SimpleErrorMessage Source #
A type of error messages
Constructors
Instances
data ErrorMessageHint Source #
Error message hints, providing more detailed information about failure.
Constructors
Instances
data HintCategory Source #
Categories of hints
Constructors
| ExprHint | |
| KindHint | |
| CheckHint | |
| PositionHint | |
| OtherHint |
Instances
newtype ErrorSuggestion Source #
Constructors
| ErrorSuggestion String |
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
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.
Constructors
| TypeMap | |
Fields
| |
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 #
colorCodeBox :: Maybe (ColorIntensity, Color) -> Box -> Box Source #
defaultCodeColor :: (ColorIntensity, Color) Source #
Default color intesity and color for code
data PPEOptions Source #
prettyPrintSingleError Options
Constructors
| PPEOptions | |
Fields
| |
defaultPPEOptions :: PPEOptions Source #
Default options for PPEOptions
prettyPrintSingleError :: PPEOptions -> ErrorMessage -> Box Source #
Pretty print a single error, simplifying if necessary
prettyPrintImport :: ModuleName -> ImportDeclarationType -> Maybe ModuleName -> String Source #
prettyPrintMultipleErrors :: PPEOptions -> MultipleErrors -> String Source #
Pretty print multiple errors
prettyPrintMultipleWarnings :: PPEOptions -> MultipleErrors -> String Source #
Pretty print multiple warnings
prettyPrintMultipleWarningsBox :: PPEOptions -> MultipleErrors -> [Box] Source #
Pretty print warnings as a Box
prettyPrintMultipleErrorsBox :: PPEOptions -> MultipleErrors -> [Box] Source #
Pretty print errors as a Box
prettyPrintMultipleErrorsWith :: PPEOptions -> String -> String -> 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 :: 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 #
escalateWarningWhen :: (MonadWriter MultipleErrors m, MonadError MultipleErrors m) => (ErrorMessage -> Bool) -> m a -> m a Source #
Runs a computation listening for warnings and then escalating any warnings that match the predicate to error status.
parU :: MonadError MultipleErrors m => [a] -> (a -> m b) -> m [b] Source #
Collect errors in in parallel