on master help sign in
Remove duplicate function (lmap2) in Producer module
4e252a8Adithya Kumar
core/src/Streamly/Internal/Data/Array/Foreign.hs+1−1
@@ -183,7 +183,7 @@ fromStream (SerialT m) = P.fold A.write m
183{-# INLINE_NORMAL producer #-}
183{-# INLINE_NORMAL producer #-}
184producer :: forall m a. (Monad m, Storable a) => Producer m (Array a) a
184producer :: forall m a. (Monad m, Storable a) => Producer m (Array a) a
185producer =
185producer =
186− Producer.lmap2 A.unsafeThaw A.unsafeFreeze
186+ Producer.translate A.unsafeThaw A.unsafeFreeze
187 $ MA.producerWith (return . unsafeInlineIO)
187 $ MA.producerWith (return . unsafeInlineIO)
188
188
189-- | Unfold an array into a stream.
189-- | Unfold an array into a stream.
core/src/Streamly/Internal/Data/Producer/Type.hs−8
@@ -23,7 +23,6 @@ module Streamly.Internal.Data.Producer.Type
23 -- * Mapping
23 -- * Mapping
24 , translate
24 , translate
25 , lmap
25 , lmap
26− , lmap2
27
26
28 -- * Nesting
27 -- * Nesting
29 , NestedLoop (..)
28 , NestedLoop (..)
@@ -113,13 +112,6 @@ translate f g (Producer step inject extract) =
113lmap :: (a -> a) -> Producer m a b -> Producer m a b
112lmap :: (a -> a) -> Producer m a b -> Producer m a b
114lmap f (Producer step inject extract) = Producer step (inject . f) extract
113lmap f (Producer step inject extract) = Producer step (inject . f) extract
115
114
116−-- | Map the producer input using the provided translation functions
117−--
118−-- /Pre-release/
119−{-# INLINE_NORMAL lmap2 #-}
120−lmap2 :: Functor m => (a -> c) -> (c -> a) -> Producer m c b -> Producer m a b
121−lmap2 f g (Producer step inject extract) = Producer step (inject . f) (fmap g . extract)
122−
123------------------------------------------------------------------------------
115------------------------------------------------------------------------------
124-- Functor
116-- Functor
125------------------------------------------------------------------------------
117------------------------------------------------------------------------------