streamly-core: Add infixr 5 fixity for cons, consM
commit30c97a396653abf7115120826be0ec923e11851e
authorpranaysashank <pranaysashank@gmail.com>
dateSat 23 Dec 2023, 14:09 (3 years ago)
parent4032b64
core/docs/Changelog.md+4
@@ -1,5 +1,9 @@
11# Changelog
22
3+## Unreleased
4+
5+* Add fixities `infixr 5` for `cons` and `consM` functions.
6+
37## 0.2.1 (Dec 2023)
48
59* Make the serialization of the unit constructor deterministic.
core/src/Streamly/Internal/Data/Stream/Generate.hs+2
@@ -154,6 +154,8 @@ import Streamly.Internal.Data.Stream.Type
154154nil :: Applicative m => Stream m a
155155nil = Stream (\_ _ -> pure Stop) ()
156156
157+infixr 5 `cons`
158+
157159-- XXX implement in terms of consM?
158160-- cons x = consM (return x)
159161-- From an implementation perspective, StreamK.cons translates into a
core/src/Streamly/Internal/Data/Stream/Type.hs+3
@@ -212,6 +212,9 @@ pattern Stream step state <- (unShare -> UnStream step state)
212212nilM :: Applicative m => m b -> Stream m a
213213nilM m = Stream (\_ _ -> m $> Stop) ()
214214
215+
216+infixr 5 `consM`
217+
215218-- | Like 'cons' but fuses an effect instead of a pure value.
216219{-# INLINE_NORMAL consM #-}
217220consM :: Applicative m => m a -> Stream m a -> Stream m a