Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Futhark error definitions.
Synopsis
- data CompilerError
- data ErrorClass
- externalError :: MonadError CompilerError m => Doc -> 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 -> m a
Documentation
data CompilerError Source #
A compiler error.
ExternalError Doc | 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 text is extra data for debugging, which can be written to a file. |
Instances
Show CompilerError Source # | |
Defined in Futhark.Error showsPrec :: Int -> CompilerError -> ShowS # show :: CompilerError -> String # showList :: [CompilerError] -> ShowS # | |
MonadError CompilerError FutharkM Source # | |
Defined in Futhark.Pipeline throwError :: CompilerError -> FutharkM a # catchError :: FutharkM a -> (CompilerError -> FutharkM a) -> FutharkM a # |
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
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 # | |
Show ErrorClass Source # | |
Defined in Futhark.Error showsPrec :: Int -> ErrorClass -> ShowS # show :: ErrorClass -> String # showList :: [ErrorClass] -> ShowS # |
externalError :: MonadError CompilerError m => Doc -> 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
Show InternalError Source # | |
Defined in Futhark.Error showsPrec :: Int -> InternalError -> ShowS # show :: InternalError -> String # showList :: [InternalError] -> ShowS # | |
Exception InternalError Source # | |
Defined in Futhark.Error |
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 -> m a Source #
Raise an InternalError
based on a prettyprinting result.