Copyright | [2016] Trevor L. McDonell |
---|---|
License | BSD |
Safe Haskell | None |
Language | Haskell2010 |
Error handling
Synopsis
- data Status
- describe :: Status -> String
- resultIfOk :: (Status, a) -> IO a
- nothingIfOk :: Status -> IO ()
- checkStatus :: CInt -> IO ()
- nvvmError :: String -> a
- nvvmErrorIO :: String -> IO a
- requireSDK :: Name -> Double -> a
Documentation
NVVM API function return code
Success | |
OutOfMemory | |
ProgramCreationFailure | |
IRVersionMismatch | |
InvalidInput | |
InvalidProgram | |
InvalidIR | |
InvalidOption | |
NoModuleInProgram | |
CompilationFailure |
resultIfOk :: (Status, a) -> IO a Source #
Return the result of a function on successful execution, otherwise throw an exception.
nothingIfOk :: Status -> IO () Source #
Throw an exception on an unsuccessful return code
checkStatus :: CInt -> IO () Source #
nvvmError :: String -> a Source #
Throw an exception. Exceptions may be thrown from pure code, but can only
be caught in the IO
monad.
requireSDK :: Name -> Double -> a Source #
A specially formatted error message