conduit 0.5.2.6 → 0.5.2.7
raw patch · 3 files changed
+11/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/Conduit/Text.hs +3/−2
- conduit.cabal +1/−1
- test/main.hs +7/−1
Data/Conduit/Text.hs view
@@ -123,6 +123,7 @@ -- Since 0.3.0 data TextException = DecodeException Codec Word8 | EncodeException Codec Char+ | TextException Exc.SomeException deriving (Show, Typeable) instance Exc.Exception TextException @@ -146,7 +147,7 @@ decFirst (a, b) = case tryDec a of Left _ -> Nothing Right text -> Just (text, case tryDec b of- Left exc -> Left (exc, b)+ Left exc -> Left (TextException exc, b) -- this case shouldn't occur, since splitSlowly -- is only called when parsing failed somewhere@@ -313,7 +314,7 @@ dec bytes = (T.pack (B8.unpack bytes), Right B.empty) -tryEvaluate :: a -> Either TextException a+tryEvaluate :: a -> Either Exc.SomeException a tryEvaluate = unsafePerformIO . Exc.try . Exc.evaluate maybeDecode :: (a, b) -> Maybe (a, b)
conduit.cabal view
@@ -1,5 +1,5 @@ Name: conduit-Version: 0.5.2.6+Version: 0.5.2.7 Synopsis: Streaming data processing library. Description: @conduit@ is a solution to the streaming data problem, allowing for production, transformation, and consumption of streams of data in constant memory. It is an alternative to lazy I\/O which guarantees deterministic resource handling, and fits in the same general solution space as @enumerator@/@iteratee@ and @pipes@. For a brief tutorial, please see the "Data.Conduit" module.
test/main.hs view
@@ -23,7 +23,7 @@ import qualified Data.Text as T import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Encoding as TLE-import Control.Monad.Trans.Resource (runExceptionT_, allocate, resourceForkIO)+import Control.Monad.Trans.Resource (runExceptionT, runExceptionT_, allocate, resourceForkIO) import Control.Concurrent (threadDelay, killThread) import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.Class (lift)@@ -814,6 +814,12 @@ x <- runWriterT $ source C.$$ C.transPipe (`evalStateT` 1) replaceNum1 C.=$ CL.consume y <- runWriterT $ source C.$$ C.transPipe (`evalStateT` 1) replaceNum2 C.=$ CL.consume x `shouldBe` y+ describe "text decode" $ do+ it' "doesn't throw runtime exceptions" $ do+ let x = runIdentity $ runExceptionT $ C.yield "\x89\x243" C.$$ CT.decode CT.utf8 C.=$ CL.consume+ case x of+ Left _ -> return ()+ Right t -> error $ "This should have failed: " ++ show t it' :: String -> IO () -> Spec it' = it