packages feed

hw-streams 0.0.0.2 → 0.0.0.3

raw patch · 2 files changed

+3/−3 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- HaskellWorks.Data.Streams.Stream: transcribe :: (s -> a -> b) -> s -> Stream a -> Stream b
+ HaskellWorks.Data.Streams.Stream: transcribe :: (s -> a -> (b, s)) -> s -> Stream a -> Stream b

Files

hw-streams.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack  name:           hw-streams-version:        0.0.0.2+version:        0.0.0.3 synopsis:       Primitive functions and data types description:    Primitive functions and data types. category:       Data
src/HaskellWorks/Data/Streams/Stream.hs view
@@ -102,10 +102,10 @@ repeat n a = Stream step n 1   where step i = if i > 0 then Yield a (i - 1) else Done -transcribe :: (s -> a -> b) -> s -> Stream a -> Stream b+transcribe :: (s -> a -> (b, s)) -> s -> Stream a -> Stream b transcribe f w (Stream step state size) = Stream step' (state, w) size   where step' (t, x) = case step t of-          Yield a s' -> let z = f x a in Yield z (s', x)+          Yield a s' -> let (z, y) = f x a in Yield z (s', y)           Skip    s' -> Skip (s', x)           Done       -> Done         {-# INLINE step' #-}