purescript-0.12.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell2010

Language.PureScript.Errors

Synopsis

Documentation

errorSpan :: ErrorMessage -> Maybe (NonEmpty 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 -> Text 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

errorMessage' :: SourceSpan -> SimpleErrorMessage -> MultipleErrors Source #

Create an error set from a single simple error message and source annotation

errorMessage'' :: NonEmpty SourceSpan -> SimpleErrorMessage -> MultipleErrors Source #

Create an error set from a single simple error message and source annotations

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

addHints :: [ErrorMessageHint] -> MultipleErrors -> MultipleErrors Source #

Add hints 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 :: forall m a b. MonadError MultipleErrors m => [a] -> (a -> m b) -> m [b] Source #

Collect errors in in parallel