purescript- PureScript Programming Language Compiler

Safe HaskellNone




data SimpleErrorMessage Source

A type of error messages


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 
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 
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 
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 
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] 
InvalidOperatorInBinder Ident Ident 

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.


data Level Source

How critical the issue is




unwrapErrorMessage :: ErrorMessage -> SimpleErrorMessage Source

Extract nested error messages from wrapper errors

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

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 :: (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

parU :: (MonadError MultipleErrors m, Functor m) => [a] -> (a -> m b) -> m [b] Source

Collect errors in in parallel