Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Futhark error definitions.
Synopsis
- data CompilerError
- prettyCompilerError :: CompilerError -> Doc AnsiStyle
- data ErrorClass
- externalError :: MonadError CompilerError m => Doc AnsiStyle -> m a
- externalErrorS :: MonadError CompilerError m => String -> m a
- data InternalError = Error ErrorClass Text
- compilerBug :: Text -> a
- compilerBugS :: String -> a
- compilerLimitation :: Text -> a
- compilerLimitationS :: String -> a
- internalErrorS :: MonadError CompilerError m => String -> Doc AnsiStyle -> m a
Documentation
data CompilerError Source #
A compiler error.
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
MonadError CompilerError FutharkM Source # | |
Defined in Futhark.Pipeline throwError :: CompilerError -> FutharkM a # catchError :: FutharkM a -> (CompilerError -> FutharkM a) -> FutharkM a # |
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
Show ErrorClass Source # | |
Defined in Futhark.Error showsPrec :: Int -> ErrorClass -> ShowS # show :: ErrorClass -> String # showList :: [ErrorClass] -> ShowS # | |
Eq ErrorClass Source # | |
Defined in Futhark.Error (==) :: ErrorClass -> ErrorClass -> Bool # (/=) :: ErrorClass -> ErrorClass -> Bool # | |
Ord ErrorClass Source # | |
Defined in Futhark.Error compare :: ErrorClass -> ErrorClass -> Ordering # (<) :: ErrorClass -> ErrorClass -> Bool # (<=) :: ErrorClass -> ErrorClass -> Bool # (>) :: ErrorClass -> ErrorClass -> Bool # (>=) :: ErrorClass -> ErrorClass -> Bool # max :: ErrorClass -> ErrorClass -> ErrorClass # min :: ErrorClass -> ErrorClass -> ErrorClass # |
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.
Instances
Exception InternalError Source # | |
Defined in Futhark.Error | |
Show InternalError Source # | |
Defined in Futhark.Error showsPrec :: Int -> InternalError -> ShowS # show :: InternalError -> String # showList :: [InternalError] -> ShowS # |
compilerBug :: Text -> a Source #
Throw an InternalError
that is a CompilerBug
.
compilerBugS :: String -> a Source #
Like compilerBug
, but with a String
.
compilerLimitation :: Text -> a Source #
Throw an InternalError
that is a CompilerLimitation
.
compilerLimitationS :: String -> a Source #
Like compilerLimitation
, but with a String
.
internalErrorS :: MonadError CompilerError m => String -> Doc AnsiStyle -> m a Source #
Raise an InternalError
based on a prettyprinting result.