Hoogle Search
Within LTS Haskell 24.6 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapMArrayM_ :: (MArray a e m, Ix i) => (e -> m b) -> a i e -> m ()array Data.Array.MArray.Safe Map elements to monadic actions, sequence them left-to-right, and discard the results.
mapArray' :: (a -> b) -> Array a -> Array bprimitive Data.Primitive.Array Strict map over the elements of the array.
mapMaybePrimArray :: (Prim a, Prim b) => (a -> Maybe b) -> PrimArray a -> PrimArray bprimitive Data.Primitive.PrimArray Map over a primitive array, optionally discarding some elements. This has the same behavior as Data.Maybe.mapMaybe.
-
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.
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"
mappedException' :: Exception e' => Setter s s SomeException e'lens Control.Exception.Lens This is a type restricted version of mappedException, which avoids the type ambiguity in the input Exception when using set. The following maps any exception to arithmetic overflow:
>>> handling _Overflow (\_ -> return "caught") $ assert False (return "uncaught") & mappedException' .~ Overflow "caught"
mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)lens Control.Lens.Combinators This generalizes mapAccumL to an arbitrary Traversal.
mapAccumL ≡ mapAccumLOf traverse
mapAccumLOf accumulates State from left to right.mapAccumLOf :: Iso s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) mapAccumLOf :: Lens s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) mapAccumLOf :: Traversal s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) mapAccumLOf l f acc0 s = swap (runState (l (a -> state (acc -> swap (f acc a))) s) acc0)