purescript- PureScript Programming Language Compiler

Safe HaskellNone






data SimpleErrorMessage Source

A type of error messages


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 
MultipleFixities Ident 
OrphanTypeDeclaration Ident 
OrphanFixityDeclaration String 
RedefinedModule ModuleName 
RedefinedIdent Ident 
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 
CycleInDeclaration Ident 
CycleInTypeSynonym (Maybe ProperName) 
CycleInModules [ModuleName] 
NameIsUndefined Ident 
NameNotInScope Ident 
UndefinedTypeVariable ProperName 
PartiallyAppliedSynonym (Qualified ProperName) 
EscapedSkolem (Maybe Expr) 
TypesDoNotUnify Type Type 
KindsDoNotUnify Kind Kind 
ConstrainedTypeUnified Type Type 
OverlappingInstances (Qualified ProperName) [Type] [DictionaryValue] 
NoInstanceFound (Qualified ProperName) [Type] 
CannotDerive (Qualified ProperName) [Type] 
CannotFindDerivingType ProperName 
DuplicateLabel String (Maybe Expr) 
DuplicateValueDeclaration Ident 
ArgListLengthsDiffer Ident 
OverlappingArgNames (Maybe Ident) 
MissingClassMember Ident 
ExtraneousClassMember Ident 
ExpectedType Kind 
IncorrectConstructorArity (Qualified ProperName) 
ExprDoesNotHaveType Expr Type 
PropertyIsMissing String Type 
CannotApplyFunction Type Expr 
OrphanInstance Ident (Qualified ProperName) [Type] 
InvalidInstanceHead Type 
TransitiveExportError DeclarationRef [DeclarationRef] 
ShadowedName Ident 
WildcardInferredType Type 
NotExhaustivePattern [[Binder]] Bool 
OverlappingPattern [[Binder]] Bool 
ClassOperator ProperName Ident 

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

data LabelType Source

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.

data Level Source

How critical the issue is




unwrapErrorMessage :: ErrorMessage -> SimpleErrorMessage Source

Extract nested error messages from wrapper errors

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

prettyPrintMultipleWarningsBox :: Bool -> MultipleErrors -> Box Source

Pretty print warnings as a Box

prettyPrintMultipleErrorsBox :: Bool -> MultipleErrors -> Box Source

Pretty print errors as a Box

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