Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant dependency safe-exceptions #85

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions inline-c-cpp/inline-c-cpp.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ library
build-depends: base >=4.7 && <5
, inline-c >= 0.6.1.0
, template-haskell
, safe-exceptions
hs-source-dirs: src
default-language: Haskell2010
cc-options: -Wall -Werror
Expand All @@ -36,7 +35,6 @@ test-suite tests
build-depends: base >=4 && <5
, inline-c
, inline-c-cpp
, safe-exceptions
, hspec
default-language: Haskell2010
extra-libraries: stdc++
Expand Down
6 changes: 3 additions & 3 deletions inline-c-cpp/src/Language/C/Inline/Cpp/Exceptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Language.C.Inline.Cpp.Exceptions
, catchBlock
) where

import Control.Exception.Safe
import Control.Exception (Exception, mask_, throwIO)
import qualified Language.C.Inline as C
import qualified Language.C.Inline.Internal as C
import Language.Haskell.TH
Expand Down Expand Up @@ -87,7 +87,7 @@ catchBlock = QuasiQuoter
, quoteDec = unsupported
} where
unsupported _ = fail "Unsupported quasiquotation."


tryBlockQuoteExp :: String -> Q Exp
tryBlockQuoteExp blockStr = do
Expand Down Expand Up @@ -147,7 +147,7 @@ tryBlockQuoteExp blockStr = do
, "}"
]
[e| handleForeignCatch $ \ $(varP typePtrVarName) $(varP msgPtrVarName) -> $(quoteExp C.block inlineCStr) |]

-- | Similar to `C.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@.
tryBlock :: QuasiQuoter
Expand Down
2 changes: 1 addition & 1 deletion inline-c-cpp/test/tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}

import Control.Exception.Safe
import Control.Exception (try)
import Control.Monad
import qualified Language.C.Inline.Cpp as C
import qualified Language.C.Inline.Cpp.Exceptions as C
Expand Down