purescript-0.7.0.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript.Errors

Description

 

Synopsis

Documentation

data SimpleErrorMessage Source

A type of error messages

Constructors

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 
CannotReorderOperators 
MultipleFixities Ident 
OrphanTypeDeclaration Ident 
OrphanFixityDeclaration String 
RedefinedModule ModuleName 
RedefinedIdent Ident 
OverlappingNamesInLet 
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 
InvalidDoBind 
InvalidDoLet 
CycleInDeclaration Ident 
CycleInTypeSynonym (Maybe ProperName) 
CycleInModules [ModuleName] 
NameIsUndefined Ident 
NameNotInScope Ident 
UndefinedTypeVariable ProperName 
PartiallyAppliedSynonym (Qualified ProperName) 
EscapedSkolem (Maybe Expr) 
UnspecifiedSkolemScope 
TypesDoNotUnify Type Type 
KindsDoNotUnify Kind Kind 
ConstrainedTypeUnified Type Type 
OverlappingInstances (Qualified ProperName) [Type] [DictionaryValue] 
NoInstanceFound (Qualified ProperName) [Type] 
DuplicateLabel String (Maybe Expr) 
DuplicateValueDeclaration Ident 
ArgListLengthsDiffer Ident 
OverlappingArgNames (Maybe Ident) 
MissingClassMember Ident 
ExtraneousClassMember Ident 
ExpectedType Kind 
IncorrectConstructorArity (Qualified ProperName) 
SubsumptionCheckFailed 
ExprDoesNotHaveType Expr Type 
PropertyIsMissing String Type 
CannotApplyFunction Type Expr 
TypeSynonymInstance 
InvalidNewtype 
InvalidInstanceHead Type 
TransitiveExportError DeclarationRef [DeclarationRef] 
ShadowedName Ident 
WildcardInferredType Type 
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.

unwrapErrorMessage :: ErrorMessage -> SimpleErrorMessage Source

Extract nested error messages from wrapper errors

prettyPrintSingleError :: Bool -> 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

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