packages feed

machines-io 0.2.0.2 → 0.2.0.4

raw patch · 2 files changed

+7/−9 lines, 2 filesdep ~basedep ~machinesPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, machines

API changes (from Hackage documentation)

Files

machines-io.cabal view
@@ -1,5 +1,5 @@ name:                machines-io-version:             0.2.0.2+version:             0.2.0.4 synopsis:            IO utilities for the machines library homepage:            http://github.com/aloiscochard/machines-io license:             Apache-2.0@@ -13,12 +13,12 @@ library   default-language:  Haskell2010   hs-source-dirs:    src-  ghc-options:       -fwarn-incomplete-patterns+  ghc-options:       -Wall   exposed-modules:      System.IO.Machine   build-depends:            base >=4.6 && < 5     , bytestring          >= 0.10     && < 0.11     , chunked-data        >= 0.1      && < 0.3-    , machines            >= 0.2      && < 0.5+    , machines            >= 0.2      && < 0.6     , transformers        >= 0.3      && < 0.5
src/System/IO/Machine.hs view
@@ -1,13 +1,11 @@ {-# LANGUAGE Rank2Types #-} module System.IO.Machine where -import Control.Applicative ((<$>))-import Control.Monad (when) import Control.Monad.IO.Class (MonadIO, liftIO) import Data.IOData (IOData, hGetLine, hPutStrLn) import Data.Machine import Data.Word (Word8)-import System.IO (Handle, IOMode(ReadMode), hClose, hIsEOF, openBinaryFile)+import System.IO (Handle, hIsEOF)  import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BSC8@@ -36,14 +34,14 @@ sourceHandle (r, _) = sourceHandleWith r  sourceIOWith :: m r -> (r -> m Bool) -> (r -> m a) -> SourceIO m a-sourceIOWith acquire release read = MachineT $ do+sourceIOWith acquire release read' = MachineT $ do   r         <- acquire   released  <- release r   if released then     return Stop   else do-    x <- read r-    return . Yield x $ sourceIOWith acquire release read+    x <- read' r+    return . Yield x $ sourceIOWith acquire release read'  sourceHandleWith :: (Handle -> m a) -> Handle -> SourceIO m a sourceHandleWith f h = sourceIOWith (return h) (liftIO . hIsEOF) f