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.

  1. mapMaybePrimArrayA :: (Applicative f, Prim a, Prim b) => (a -> f (Maybe b)) -> PrimArray a -> f (PrimArray b)

    primitive Data.Primitive.PrimArray

    Map over the primitive array, keeping the elements for which the applicative predicate provides a Just.

  2. mapMaybePrimArrayP :: (PrimMonad m, Prim a, Prim b) => (a -> m (Maybe b)) -> PrimArray a -> m (PrimArray b)

    primitive Data.Primitive.PrimArray

    Map over the primitive array, keeping the elements for which the monadic predicate provides a Just.

  3. mapPrimArray :: (Prim a, Prim b) => (a -> b) -> PrimArray a -> PrimArray b

    primitive Data.Primitive.PrimArray

    Map over the elements of a primitive array.

  4. mapSmallArray' :: (a -> b) -> SmallArray a -> SmallArray b

    primitive Data.Primitive.SmallArray

    Strict map over the elements of the array.

  5. 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 with
    results <- 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.

  6. 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_.

  7. 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 with
    results <- 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.

  8. 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_.

  9. 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.

  10. 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"
    

Page 113 of many | Previous | Next