futhark-0.23.1: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Futhark.Error

Description

Futhark error definitions.

Synopsis

Documentation

data CompilerError Source #

A compiler error.

Constructors

ExternalError (Doc AnsiStyle)

An error that happened due to something the user did, such as provide incorrect code or options.

InternalError Text Text ErrorClass

An internal compiler error. The second pretty is extra data for debugging, which can be written to a file.

Instances

Instances details
MonadError CompilerError FutharkM Source # 
Instance details

Defined in Futhark.Pipeline

prettyCompilerError :: CompilerError -> Doc AnsiStyle Source #

Print an error intended for human consumption.

data ErrorClass Source #

There are two classes of internal errors: actual bugs, and implementation limitations. The latter are already known and need not be reported.

Instances

Instances details
Show ErrorClass Source # 
Instance details

Defined in Futhark.Error

Eq ErrorClass Source # 
Instance details

Defined in Futhark.Error

Ord ErrorClass Source # 
Instance details

Defined in Futhark.Error

externalError :: MonadError CompilerError m => Doc AnsiStyle -> m a Source #

Raise an ExternalError based on a prettyprinting result.

externalErrorS :: MonadError CompilerError m => String -> m a Source #

Raise an ExternalError based on a string.

data InternalError Source #

An error that is not the users fault, but a bug (or limitation) in the compiler. Compiler passes should only ever report this error - any problems after the type checker are *our* fault, not the users. These are generally thrown as IO exceptions, and caught at the top level.

Constructors

Error ErrorClass Text 

compilerBug :: Text -> a Source #

Throw an InternalError that is a CompilerBug.

compilerBugS :: String -> a Source #

Like compilerBug, but with a String.

internalErrorS :: MonadError CompilerError m => String -> Doc AnsiStyle -> m a Source #

Raise an InternalError based on a prettyprinting result.