Commits

Bryan O'Sullivan  committed 5787a02

Adapt to GHC 7.6 dropping catch from Prelude

  • Participants
  • Parent commits a812896

Comments (0)

Files changed (3)

File Data/Text/ICU/Regex.hs

     ) where
 
 import Data.Text.ICU.Regex.Internal
-import Control.Exception (catch)
+import qualified Control.Exception as E
 import Data.IORef (newIORef, readIORef, writeIORef)
 import Data.Text (Text)
 import qualified Data.Text.Foreign as T
 import Foreign.ForeignPtr (ForeignPtr, newForeignPtr, withForeignPtr)
 import Foreign.Marshal.Alloc (alloca)
 import Foreign.Storable (peek)
-import Prelude hiding (catch)
 import System.IO.Unsafe (unsafePerformIO)
                    
 instance Show Regex where
 -- | Compile a regular expression with the given options.  This is
 -- safest to use when the pattern is constructed at run time.
 regex' :: [MatchOption] -> Text -> IO (Either ParseError Regex)
-regex' opts pat = (Right `fmap` regex opts pat) `catch` \(err::ParseError) ->
+regex' opts pat = (Right `fmap` regex opts pat) `E.catch` \(err::ParseError) ->
                   return (Left err)
 
 -- | Set the subject text string upon which the regular expression

File Data/Text/ICU/Regex/Internal.hsc

 import Data.Word (Word16, Word32)
 import Foreign.ForeignPtr (ForeignPtr, newForeignPtr, touchForeignPtr, withForeignPtr)
 import Foreign.Ptr (FunPtr, Ptr)
-import Prelude hiding (catch)
 import System.IO.Unsafe (unsafePerformIO)
 
 #include <unicode/uregex.h>

File Data/Text/ICU/Regex/Pure.hs

     , suffix
     ) where
 
-import Control.Exception (catch)
+import qualified Control.Exception as E
 import Data.String (IsString(..))
 import Data.Text (Text)
 import qualified Data.Text as T
 import Foreign.Marshal.Alloc (alloca)
 import Foreign.Marshal.Array (advancePtr)
 import Foreign.Storable (peek)
-import Prelude hiding (catch, span)
+import Prelude hiding (span)
 import System.IO.Unsafe (unsafeInterleaveIO, unsafePerformIO)
 
 -- | A compiled regular expression.
 -- safest to use when the pattern is constructed at run time.
 regex' :: [MatchOption] -> Text -> Either ParseError Regex
 regex' opts pat = unsafePerformIO $
-  ((Right . Regex) `fmap` Internal.regex opts pat) `catch`
+  ((Right . Regex) `fmap` Internal.regex opts pat) `E.catch`
   \(err::ParseError) -> return (Left err)
 
 -- | Return the source form of the pattern used to construct this