seqid-streams 0.2.0 → 0.3.0
raw patch · 2 files changed
+11/−7 lines, 2 filesdep ~seqidPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: seqid
API changes (from Hackage documentation)
Files
seqid-streams.cabal view
@@ -1,5 +1,5 @@ name: seqid-streams-version: 0.2.0+version: 0.3.0 synopsis: Sequence ID IO-Streams description: Uniquely identify elements in a sequenced stream License: BSD3@@ -10,13 +10,16 @@ build-type: Simple cabal-version: >= 1.10 +source-repository head+ type: git+ location: git://github.com/LukeHoersten/seqid-streams.git+ library exposed-modules: System.IO.Streams.SequenceId build-depends: base >= 4.7 && < 4.8 , io-streams >= 1.2 && < 1.3- , seqid >= 0.2 && < 0.3-+ , seqid >= 0.3 && < 0.4 hs-source-dirs: src default-language: Haskell2010
src/System/IO/Streams/SequenceId.hs view
@@ -2,7 +2,7 @@ import Control.Applicative ((<$>)) import Data.SequenceId (SequenceId, SequenceIdError, checkSeqId,- nextSeqId)+ incrementSeqId) import System.IO.Streams (InputStream, OutputStream) import qualified System.IO.Streams as Streams @@ -27,11 +27,12 @@ -> (SequenceIdError -> IO ()) -- ^ Error handler -> InputStream a -- ^ 'System.IO.Streams.InputStream' to check the sequence of -> IO (InputStream a) -- ^ Pass-through of the given stream-sequenceIdInputStream initSeqId getSeqId seqFaultHandler inStream = fst <$> Streams.inputFoldM f initSeqId inStream+sequenceIdInputStream initSeqId getSeqId seqIdFaultHandler inStream =+ fst <$> Streams.inputFoldM f initSeqId inStream where f lastSeqId x = do let currSeqId = getSeqId x- maybe (return ()) seqFaultHandler $ checkSeqId lastSeqId currSeqId+ maybe (return ()) seqIdFaultHandler $ checkSeqId lastSeqId currSeqId return $ max currSeqId lastSeqId @@ -48,4 +49,4 @@ -> OutputStream a -- ^ 'System.IO.Streams.OutputStream' to count the elements of -> IO (OutputStream a, IO SequenceId) -- ^ ('IO' 'SequenceId') is the action to run to get the current sequence ID sequenceIdOutputStream = Streams.outputFoldM count- where count a _ = return $ nextSeqId a+ where count a _ = return $ incrementSeqId a