From 5df8151c7c48ad6fc326eec762f1ac2f972c7ed2 Mon Sep 17 00:00:00 2001 From: Yuriy Syrovetskiy Date: Thu, 14 Feb 2019 19:20:41 +0300 Subject: [PATCH] Remove redundant dependency safe-exceptions --- inline-c-cpp/inline-c-cpp.cabal | 2 -- inline-c-cpp/src/Language/C/Inline/Cpp/Exceptions.hs | 6 +++--- inline-c-cpp/test/tests.hs | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/inline-c-cpp/inline-c-cpp.cabal b/inline-c-cpp/inline-c-cpp.cabal index ee0d5ab..9be8def 100644 --- a/inline-c-cpp/inline-c-cpp.cabal +++ b/inline-c-cpp/inline-c-cpp.cabal @@ -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 @@ -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++ diff --git a/inline-c-cpp/src/Language/C/Inline/Cpp/Exceptions.hs b/inline-c-cpp/src/Language/C/Inline/Cpp/Exceptions.hs index 1217b04..8d1f341 100644 --- a/inline-c-cpp/src/Language/C/Inline/Cpp/Exceptions.hs +++ b/inline-c-cpp/src/Language/C/Inline/Cpp/Exceptions.hs @@ -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 @@ -87,7 +87,7 @@ catchBlock = QuasiQuoter , quoteDec = unsupported } where unsupported _ = fail "Unsupported quasiquotation." - + tryBlockQuoteExp :: String -> Q Exp tryBlockQuoteExp blockStr = do @@ -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 diff --git a/inline-c-cpp/test/tests.hs b/inline-c-cpp/test/tests.hs index b84bbd1..318f1e9 100644 --- a/inline-c-cpp/test/tests.hs +++ b/inline-c-cpp/test/tests.hs @@ -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