Bryan O'Sullivan committed 45187f0

Replace uses of throw with throwIO.

  • Participants
  • Parent commits 709995c

Comments (0)

Files changed (3)


 #include <unicode/uchar.h>
-import Control.Exception (throw)
+import Control.Exception (throwIO)
 import Data.Char (chr, ord)
 import Data.Int (Int32)
 import Data.Text.ICU.Error (isFailure, u_BUFFER_OVERFLOW_ERROR,
       (err,r) <- withError $ act ptr (fromIntegral n)
       case undefined of
        _| err == u_BUFFER_OVERFLOW_ERROR -> loop (fromIntegral r)
-        | isFailure err                  -> throw err
+        | isFailure err                  -> throwIO err
         | otherwise                      -> peekCStringLen (ptr,fromIntegral r)
 type UBlockCode = CInt


     , withError
     ) where
-import Control.Exception (Exception, throw)
+import Control.Exception (Exception, throwIO)
 import Foreign.Ptr (Ptr)
 import Foreign.Marshal.Alloc (alloca)
 import Foreign.Marshal.Utils (with)
 throwOnError code = do
   let err = (ICUError code)
   if isFailure err
-    then throw err
+    then throwIO err
     else return ()
 withError :: (Ptr UErrorCode -> IO a) -> IO (ICUError, a)
         if isParseError err
           then do
             perr <- peek perrPtr
-            throw perr { errError = err }
+            throwIO perr { errError = err }
           else if isFailure err
-               then throw err
+               then throwIO err
                else return ret
 -- | Return a string representing the name of the given error code.


 #include <unicode/uchar.h>
 #include <unicode/unorm.h>
-import Control.Exception (throw)
+import Control.Exception (throwIO)
 import Control.Monad (when)
 import Data.Text (Text)
 import Data.Text.Foreign (fromPtr, useAsPtr)
           (err, newLen) <- withError $
               unorm_normalize sptr slen' mode' 0 dptr (fromIntegral dlen)
           when (isFailure err && err /= u_BUFFER_OVERFLOW_ERROR) $
-            throw err
+            throwIO err
           let newLen' = fromIntegral newLen
           if newLen' > dlen
             then return (Left newLen')