purescript-0.9.1: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript.Errors

Synopsis

Documentation

data SimpleErrorMessage Source #

A type of error messages

Constructors

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 

errorSpan :: ErrorMessage -> Maybe SourceSpan Source #

Get the source span for an error

errorModule :: ErrorMessage -> Maybe ModuleName Source #

Get the module name for an error

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

data TypeMap Source #

A map from rigid type variable name/unknown variable pairs to new variables.

Constructors

TypeMap 

Fields

Instances

data Level Source #

How critical the issue is

Constructors

Error 
Warning 

Instances

unwrapErrorMessage :: ErrorMessage -> SimpleErrorMessage Source #

Extract nested error messages from wrapper errors

defaultCodeColor :: (ColorIntensity, Color) Source #

Default color intesity and color for code

data PPEOptions Source #

Constructors

PPEOptions 

Fields

defaultPPEOptions :: PPEOptions Source #

Default options for PPEOptions

prettyPrintSingleError :: PPEOptions -> ErrorMessage -> Box Source #

Pretty print a single error, simplifying if necessary

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

prettyPrintParseError :: ParseError -> Box Source #

Pretty print a Parsec ParseError as a Box

indent :: Box -> Box Source #

Indent to the right, and pad on top and bottom.

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

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