on master help sign in
Remove duplicate function (lmap2) in Producer module
commit4e252a890bacecbcf2a5ddb4bd9ca2e0771c2d49 authorAdithya Kumar <adithya@composewell.com> dateSat 18 Jun 2022, 22:21 (4 years ago) parent12c7787
2 files changed+1−9
core/src/Streamly/Internal/Data/Array/Foreign.hs+1−1 core/src/Streamly/Internal/Data/Producer/Type.hs−8
core/src/Streamly/Internal/Data/Array/Foreign.hs+1−1
@@ -183,7 +183,7 @@ fromStream (SerialT m) = P.fold A.write m
183183{-# INLINE_NORMAL producer #-}
184184producer :: forall m a. (Monad m, Storable a) => Producer m (Array a) a
185185producer =
186− Producer.lmap2 A.unsafeThaw A.unsafeFreeze
186+ Producer.translate A.unsafeThaw A.unsafeFreeze
187187 $ MA.producerWith (return . unsafeInlineIO)
188188
189189-- | 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
2323 -- * Mapping
2424 , translate
2525 , lmap
26− , lmap2
2726
2827 -- * Nesting
2928 , NestedLoop (..)
@@ -113,13 +112,6 @@ translate f g (Producer step inject extract) =
113112lmap :: (a -> a) -> Producer m a b -> Producer m a b
114113lmap f (Producer step inject extract) = Producer step (inject . f) extract
115114
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−
123115------------------------------------------------------------------------------
124116-- Functor
125117------------------------------------------------------------------------------