Hoogle Search
Within LTS Haskell 24.28 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)control-monad-free Control.Monad.Free Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.
Examples
mapM is literally a traverse with a type signature restricted to Monad. Its implementation may be more efficient due to additional power of Monad.mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()control-monad-free Control.Monad.Free Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see mapM. mapM_ is just like traverse_, but specialised to monadic actions.
mapWorkers :: Int -> (α -> Program τ β) -> [α] -> Program τ [β]core-program Core.Program.Workers Map a pool of workers over a list concurrently. Simply forking one Haskell thread for every item in a list is a suprisingly reasonable choice in many circumstances given how good Haskell's concurrency machinery is, and in this library can be achieved by forMing forkThread over a list of items. But if you need tighter control over the amount of concurrency—as is often the case when doing something computationally heavy or making requests of an external service with known limitations—then you are better off using this convenience function. (this was originally modelled on async's mapConcurrently. That implementation has the drawback that the number of threads created is set by the size of the structure being traversed. Here we set the amount of concurrency explicitly.) Be aware that the order of items in the output list is non-deterministic and will depend on the order that the action function completes, not the order of items in the input.
-
csv-conduit Data.CSV.Conduit Map over the rows of a CSV file. Provided for convenience for historical reasons. An easy way to run this function would be runResourceT after feeding it all the arguments.
mapEither :: (a -> c) -> (b -> d) -> Either a b -> Either c dcurrycarbon Currycarbon.Calibration.Utils No documentation available.
mapMonotonic :: (Integer -> Integer) -> IntegerInterval -> IntegerIntervaldata-interval Data.IntegerInterval mapMonotonic f i is the image of i under f, where f must be a strict monotone function.
mapMonotonic :: (Ord a, Ord b) => (a -> b) -> Interval a -> Interval bdata-interval Data.Interval mapMonotonic f i is the image of i under f, where f must be a strict monotone function, preserving negative and positive infinities.
mapKeysMonotonic :: (Ord k1, Ord k2) => (k1 -> k2) -> IntervalMap k1 a -> IntervalMap k2 adata-interval Data.IntervalMap.Lazy mapKeysMonotonic f s is the map obtained by applying f to each key of s. f must be strictly monotonic. That is, for any values x and y, if x < y then f x < f y.
mapKeysMonotonic :: (Ord k1, Ord k2) => (k1 -> k2) -> IntervalMap k1 a -> IntervalMap k2 adata-interval Data.IntervalMap.Strict mapKeysMonotonic f s is the map obtained by applying f to each key of s. f must be strictly monotonic. That is, for any values x and y, if x < y then f x < f y.
mapDecision :: (a -> b) -> (b -> a) -> Decision a -> Decision bdecidable Data.Type.Predicate Map over the value inside a Decision.