| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.C.Inline.Cpp.Exceptions
Description
Deprecated: Language.C.Inline.Cpp.Exceptions is deprecated in favor of Language.C.Inline.Cpp.Exception which changes the CppException data type to preserve the exception for custom error handling.
Synopsis
- data CppException = CppHaskellException SomeException
- pattern CppStdException :: String -> CppException
- pattern CppOtherException :: Maybe String -> CppException
- toSomeException :: CppException -> SomeException
- throwBlock :: QuasiQuoter
- tryBlock :: QuasiQuoter
- catchBlock :: QuasiQuoter
Documentation
data CppException Source #
An exception thrown in C++ code.
Constructors
| CppHaskellException SomeException |
Instances
| Exception CppException Source # | |
Defined in Language.C.Inline.Cpp.Exception Methods toException :: CppException -> SomeException # fromException :: SomeException -> Maybe CppException # displayException :: CppException -> String # | |
| Show CppException Source # | |
Defined in Language.C.Inline.Cpp.Exception Methods showsPrec :: Int -> CppException -> ShowS # show :: CppException -> String # showList :: [CppException] -> ShowS # | |
pattern CppStdException :: String -> CppException Source #
pattern CppOtherException :: Maybe String -> CppException Source #
toSomeException :: CppException -> SomeException Source #
Like toException but unwrap CppHaskellException
throwBlock :: QuasiQuoter Source #
Like tryBlock, but will throw unwrapped CppHaskellExceptions or other CppExceptions rather than returning
them in an Either
tryBlock :: QuasiQuoter Source #
Similar to block, but C++ exceptions will be caught and the result is (Either CppException value). The return type must be void or constructible with {}.
Using this will automatically include exception, cstring and cstdlib.
catchBlock :: QuasiQuoter Source #
Variant of throwBlock for blocks which return void.