Hoogle Search
Within LTS Haskell 24.62 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
primitive Data.Primitive.PrimArray Map over the primitive array, keeping the elements for which the applicative predicate provides a Just.
-
primitive Data.Primitive.PrimArray Map over the primitive array, keeping the elements for which the monadic predicate provides a Just.
mapPrimArray :: (Prim a, Prim b) => (a -> b) -> PrimArray a -> PrimArray bprimitive Data.Primitive.PrimArray Map over the elements of a primitive array.
mapSmallArray' :: (a -> b) -> SmallArray a -> SmallArray bprimitive Data.Primitive.SmallArray Strict map over the elements of the array.
mapConcurrently :: Traversable t => (a -> IO b) -> t a -> IO (t b)async Control.Concurrent.Async Maps an IO-performing function over any Traversable data type, performing all the IO actions concurrently, and returning the original data structure with the arguments replaced by the results. If any of the actions throw an exception, then all other actions are cancelled and the exception is re-thrown. For example, mapConcurrently works with lists:
pages <- mapConcurrently getURL ["url1", "url2", "url3"]
If you just have a list of actions, run them concurrently withresults <- mapConcurrently id [act1, act2, act3]
NOTE: mapConcurrently will immediately spawn a thread for each element of the Traversable, so running this on large inputs can lead to resource exhaustion (of memory, file descriptors, or other limited resources). To avoid unbounded resource usage, see Control.Concurrent.Stream.mapConcurrently_ :: Foldable f => (a -> IO b) -> f a -> IO ()async Control.Concurrent.Async mapConcurrently_ is mapConcurrently with the return value discarded; a concurrent equivalent of mapM_.
mapConcurrently :: Traversable t => (a -> IO b) -> t a -> IO (t b)async Control.Concurrent.Async.Internal Maps an IO-performing function over any Traversable data type, performing all the IO actions concurrently, and returning the original data structure with the arguments replaced by the results. If any of the actions throw an exception, then all other actions are cancelled and the exception is re-thrown. For example, mapConcurrently works with lists:
pages <- mapConcurrently getURL ["url1", "url2", "url3"]
If you just have a list of actions, run them concurrently withresults <- mapConcurrently id [act1, act2, act3]
NOTE: mapConcurrently will immediately spawn a thread for each element of the Traversable, so running this on large inputs can lead to resource exhaustion (of memory, file descriptors, or other limited resources). To avoid unbounded resource usage, see Control.Concurrent.Stream.mapConcurrently_ :: Foldable f => (a -> IO b) -> f a -> IO ()async Control.Concurrent.Async.Internal mapConcurrently_ is mapConcurrently with the return value discarded; a concurrent equivalent of mapM_.
mapConcurrentlyBounded :: Int -> (a -> IO b) -> [a] -> IO [b]async Control.Concurrent.Stream Concurrent map over a list of values, using a bounded number of threads.
mappedException :: (Exception e, Exception e') => Setter s s e e'lens Control.Exception.Lens This Setter can be used to purely map over the Exceptions an arbitrary expression might throw; it is a variant of mapException in the same way that mapped is a variant of fmap.
'mapException' ≡ 'over' 'mappedException'
This view that every Haskell expression can be regarded as carrying a bag of Exceptions is detailed in “A Semantics for Imprecise Exceptions” by Peyton Jones & al. at PLDI ’99. The following maps failed assertions to arithmetic overflow:>>> handling _Overflow (\_ -> return "caught") $ assert False (return "uncaught") & mappedException %~ \ (AssertionFailed _) -> Overflow "caught"