purescript-0.11.5: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell2010

Language.PureScript.Errors

Synopsis

Documentation

newtype ErrorSuggestion #

Constructors

ErrorSuggestion Text 

errorSpan :: ErrorMessage -> Maybe SourceSpan #

Get the source span for an error

errorModule :: ErrorMessage -> Maybe ModuleName #

Get the module name for an error

stripModuleAndSpan :: ErrorMessage -> ErrorMessage #

Remove the module name and span hints from an error

errorCode :: ErrorMessage -> Text #

Get the error code for a particular error type

nonEmpty :: MultipleErrors -> Bool #

Check whether a collection of errors is empty or not.

errorMessage :: SimpleErrorMessage -> MultipleErrors #

Create an error set from a single simple error message

singleError :: ErrorMessage -> MultipleErrors #

Create an error set from a single error message

onErrorMessages :: (ErrorMessage -> ErrorMessage) -> MultipleErrors -> MultipleErrors #

Lift a function on ErrorMessage to a function on MultipleErrors

addHint :: ErrorMessageHint -> MultipleErrors -> MultipleErrors #

Add a hint to an error message

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

Add hints to an error message

data TypeMap #

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

Constructors

TypeMap 

Fields

Instances

data Level #

How critical the issue is

Constructors

Error 
Warning 

Instances

unwrapErrorMessage :: ErrorMessage -> SimpleErrorMessage #

Extract nested error messages from wrapper errors

defaultCodeColor :: (ColorIntensity, Color) #

Default color intesity and color for code

data PPEOptions #

Constructors

PPEOptions 

Fields

defaultPPEOptions :: PPEOptions #

Default options for PPEOptions

prettyPrintSingleError :: PPEOptions -> ErrorMessage -> Box #

Pretty print a single error, simplifying if necessary

prettyPrintMultipleErrors :: PPEOptions -> MultipleErrors -> String #

Pretty print multiple errors

prettyPrintMultipleWarnings :: PPEOptions -> MultipleErrors -> String #

Pretty print multiple warnings

prettyPrintMultipleWarningsBox :: PPEOptions -> MultipleErrors -> [Box] #

Pretty print warnings as a Box

prettyPrintMultipleErrorsBox :: PPEOptions -> MultipleErrors -> [Box] #

Pretty print errors as a Box

prettyPrintParseError :: ParseError -> Box #

Pretty print a Parsec ParseError as a Box

indent :: Box -> Box #

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

line :: Text -> Box #

rethrow :: MonadError e m => (e -> e) -> m a -> m a #

Rethrow an error with a more detailed error message in the case of failure

reifyErrors :: MonadError e m => m a -> m (Either e a) #

reflectErrors :: MonadError e m => m (Either e a) -> m a #

warnAndRethrow :: (MonadError e m, MonadWriter e m) => (e -> e) -> m a -> m a #

rethrowWithPosition :: MonadError MultipleErrors m => SourceSpan -> m a -> m a #

Rethrow an error with source position information

escalateWarningWhen :: (MonadWriter MultipleErrors m, MonadError MultipleErrors m) => (ErrorMessage -> Bool) -> m a -> m a #

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] #

Collect errors in in parallel