Hoogle Search
Within LTS Haskell 24.32 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
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)
-
lens Control.Lens.Combinators This generalizes mapAccumR to an arbitrary Traversal.
mapAccumR ≡ mapAccumROf traverse
mapAccumROf accumulates State from right to left.mapAccumROf :: Iso s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) mapAccumROf :: Lens s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) mapAccumROf :: Traversal s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumROf :: LensLike (Backwards (State acc)) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapEq :: forall k1 k2 (s :: k1) (t :: k2) (a :: k1) (b :: k2) f . AnEquality s t a b -> f s -> f alens Control.Lens.Combinators We can use Equality to do substitution into anything.