packages feed

hw-streams 0.0.0.3 → 0.0.0.4

raw patch · 2 files changed

+16/−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: concatMap :: (a -> Stream b) -> Stream a -> Stream b
- HaskellWorks.Data.Streams.Internal.Chunk: Chunk :: Int -> forall m. PrimMonad m => MVector (PrimState m) a -> m () -> Chunk a
+ HaskellWorks.Data.Streams.Internal.Chunk: Chunk :: Int -> (forall m. PrimMonad m => MVector (PrimState m) a -> m ()) -> Chunk a

Files

hw-streams.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack  name:           hw-streams-version:        0.0.0.3+version:        0.0.0.4 synopsis:       Primitive functions and data types description:    Primitive functions and data types. category:       Data
src/HaskellWorks/Data/Streams/Stream.hs view
@@ -1,5 +1,6 @@-{-# LANGUAGE CPP   #-}-{-# LANGUAGE GADTs #-}+{-# LANGUAGE CPP        #-}+{-# LANGUAGE GADTs      #-}+{-# LANGUAGE RankNTypes #-}  module HaskellWorks.Data.Streams.Stream where @@ -110,3 +111,15 @@           Done       -> Done         {-# INLINE step' #-} {-# INLINE transcribe #-}++concatMap :: (a -> Stream b) -> Stream a -> Stream b+concatMap f (Stream stepA stateA _) = Stream stepC (stateA, Nothing) Unknown+  where stepC (stateA0, Nothing) = case stepA stateA0 of+          Yield a stateA1 -> Skip (stateA1, Just (f a))+          Skip    stateA1 -> Skip (stateA1, Nothing)+          Done            -> Done+        stepC (stateA0, Just (Stream stepB stateB _)) = case stepB stateB of+          Yield b stateB1 -> Yield b  (stateA0, Just (Stream stepB stateB1 Unknown))+          Skip    stateB1 -> Skip     (stateA0, Just (Stream stepB stateB1 Unknown))+          Done            -> Skip     (stateA0, Nothing)+{-# INLINE concatMap #-}