@@ -23,6 +23,7 @@ module Streamly.Internal.Data.Producer.Type
23 -- * Mapping
23 -- * Mapping
24 , translate
24 , translate
27 -- * Nesting
28 -- * Nesting
28 , NestedLoop (..)
29 , NestedLoop (..)
@@ -112,6 +113,13 @@ translate f g (Producer step inject extract) =
112lmap :: (a -> a) -> Producer m a b -> Producer m a b
113lmap :: (a -> a) -> Producer m a b -> Producer m a b
113lmap f (Producer step inject extract) = Producer step (inject . f) extract
114lmap f (Producer step inject extract) = Producer step (inject . f) extract
116+-- | Map the producer input using the provided translation functions
119+{-# INLINE_NORMAL lmap_ #-}
120+lmap_ :: Functor m => (a -> c) -> (c -> a) -> Producer m c b -> Producer m a b
121+lmap_ f g (Producer step inject extract) = Producer step (inject . f) (fmap g . extract)
115------------------------------------------------------------------------------
123------------------------------------------------------------------------------
116-- Functor
124-- Functor
117------------------------------------------------------------------------------
125------------------------------------------------------------------------------