streaming 0.2.0.0 → 0.2.1.0
raw patch · 5 files changed
+67/−9 lines, 5 filesdep +semigroupsdep −exceptionsdep ~base
Dependencies added: semigroups
Dependencies removed: exceptions
Dependency ranges changed: base
Files
- README.md +1/−2
- changelog.md +45/−0
- src/Data/Functor/Of.hs +8/−1
- src/Streaming/Internal.hs +9/−2
- streaming.cabal +4/−4
README.md view
@@ -1,5 +1,4 @@-streaming-=========+# streaming [](https://hackage.haskell.org/package/streaming) Contents --------
+ changelog.md view
@@ -0,0 +1,45 @@+- 0.2.1.0++ Adding `Semigroup` instances for GHC 8.4.++- 0.2.0.0++ Remove `bracketStream`, `MonadCatch` instance, and everything+ dealing with `ResourceT`. All of these things of sort of+ broken for `Stream` since there is no guarantee of linear+ consumption (functions like `take` can prevent finalizers+ from running). The `streaming-with` library is recommended+ to get this kind of behavior.++ Add `Semigroup` instances for `Of` and `Stream`.++ Drop unneeded dependency on exceptions.++- 0.2.0.0++ Made `zipsWith` and allied functions short-circuit; if the+ first stream is empty, ignore the second one.++ Deprecated `mapsExposed` and `mapsMExposed`. These were perfectly+ safe copies of `maps` and `mapsM` with scary names.++ Made the `Show` and `Eq` instances for `Stream` respect the+ abstraction. In effect, the streams are `unexposed` before+ being shown or tested for equality.++ Added `Eq1`, `Ord`, `Ord1`, and `Show1` instances for `Stream`.++ Added `Generic`, `Generic1`, `Eq1`, `Ord1`, `Show1`, `Eq2`, `Ord2`,+ and `Show2` instances for `Of`.++ Bump the lower bound on `transformers` to 0.5.++ Break compatibility with pre-AMP base. Prefer `fmap` to `liftM`.++- 0.1.3.0 ++ Added `duplicate` and `store` for simultaneous folding.+ + Added `mapped` for the ugly `mapsM`+ + `mwrap` renamed `effect`
src/Data/Functor/Of.hs view
@@ -1,7 +1,8 @@ {-# LANGUAGE CPP, DeriveDataTypeable, DeriveTraversable, DeriveFoldable, DeriveGeneric #-} module Data.Functor.Of where-import Data.Monoid+import Data.Monoid (Monoid (..))+import Data.Semigroup (Semigroup (..)) import Control.Applicative import Data.Traversable (Traversable) import Data.Foldable (Foldable)@@ -19,11 +20,17 @@ Read, Show, Traversable, Typeable, Generic, Generic1) infixr 5 :> +instance (Semigroup a, Semigroup b) => Semigroup (Of a b) where+ (m :> w) <> (m' :> w') = (m <> m') :> (w <> w')+ {-#INLINE (<>) #-}+ instance (Monoid a, Monoid b) => Monoid (Of a b) where mempty = mempty :> mempty {-#INLINE mempty #-}+#if !(MIN_VERSION_base(4,11,0)) mappend (m :> w) (m' :> w') = mappend m m' :> mappend w w' {-#INLINE mappend #-}+#endif instance Functor (Of a) where fmap f (a :> x) = a :> f x
src/Streaming/Internal.hs view
@@ -94,7 +94,8 @@ import Control.Applicative import Data.Function ( on ) import Control.Monad.Morph-import Data.Monoid (Monoid (..), (<>))+import Data.Monoid (Monoid (..))+import Data.Semigroup (Semigroup (..)) import Data.Data (Typeable) import Prelude hiding (splitAt) import Data.Functor.Compose@@ -295,11 +296,17 @@ str <|> str' = zipsWith' liftA2 str str' {-#INLINE (<|>) #-} +instance (Functor f, Monad m, Semigroup w) => Semigroup (Stream f m w) where+ a <> b = a >>= \w -> fmap (w <>) b+ {-#INLINE (<>) #-}+ instance (Functor f, Monad m, Monoid w) => Monoid (Stream f m w) where mempty = return mempty {-#INLINE mempty #-}- mappend a b = a >>= \w -> fmap (w <>) b+#if !(MIN_VERSION_base(4,11,0))+ mappend a b = a >>= \w -> fmap (w `mappend`) b {-#INLINE mappend #-}+#endif instance (Applicative f, Monad m) => MonadPlus (Stream f m) where mzero = empty
streaming.cabal view
@@ -1,5 +1,5 @@ name: streaming-version: 0.2.0.0+version: 0.2.1.0 cabal-version: >=1.10 build-type: Simple synopsis: an elementary streaming prelude and general stream type.@@ -91,7 +91,7 @@ to mention a few obviously desirable operations. (This is explained more elaborately in the <https://hackage.haskell.org/package/streaming#readme readme> below.) .- One could throw of course throw something+ One could of course throw something like the present @Stream@ type on top of a prior stream concept: this is how @pipes@ and @pipes-group@ (which are very much our model here) use @FreeT@. But once one grasps the iterable stream concept needed to express@@ -191,7 +191,7 @@ homepage: https://github.com/haskell-streaming/streaming bug-reports: https://github.com/haskell-streaming/streaming/issues category: Data, Pipes, Streaming-extra-source-files: README.md+extra-source-files: README.md, changelog.md source-repository head type: git@@ -217,9 +217,9 @@ base >=4.8 && <5 , mtl >=2.1 && <2.3 , mmorph >=1.0 && <1.2+ , semigroups >= 0.18 && <0.19 , transformers >=0.5 && <0.6 , transformers-base < 0.5- , exceptions > 0.5 && < 0.9 , ghc-prim , containers hs-source-dirs: src