Hoogle Search

Within LTS Haskell 24.33 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

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

    primitive Data.Primitive.PrimArray

    Map over the elements of a primitive array.

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

    primitive Data.Primitive.SmallArray

    Strict map over the elements of the array.

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

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

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

    mapAccumLmapAccumLOf 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)
    

  6. mapAccumROf :: LensLike (Backwards (State acc)) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

    lens Control.Lens.Combinators

    This generalizes mapAccumR to an arbitrary Traversal.

    mapAccumRmapAccumROf 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)
    

  7. mapEq :: forall k1 k2 (s :: k1) (t :: k2) (a :: k1) (b :: k2) f . AnEquality s t a b -> f s -> f a

    lens Control.Lens.Combinators

    We can use Equality to do substitution into anything.

  8. mapMOf :: LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t

    lens Control.Lens.Combinators

    Map each element of a structure targeted by a Lens to a monadic action, evaluate these actions from left to right, and collect the results.

    >>> mapMOf both (\x -> [x, x + 1]) (1,3)
    [(1,3),(1,4),(2,3),(2,4)]
    
    mapMmapMOf traverse
    imapMOf l ≡ forM l . Indexed
    
    mapMOf :: Monad m => Iso s t a b       -> (a -> m b) -> s -> m t
    mapMOf :: Monad m => Lens s t a b      -> (a -> m b) -> s -> m t
    mapMOf :: Monad m => Traversal s t a b -> (a -> m b) -> s -> m t
    

  9. mapMOf_ :: Monad m => Getting (Sequenced r m) s a -> (a -> m r) -> s -> m ()

    lens Control.Lens.Combinators

    Map each target of a Fold on a structure to a monadic action, evaluate these actions from left to right, and ignore the results.

    >>> mapMOf_ both putStrLn ("hello","world")
    hello
    world
    
    mapM_mapMOf_ folded
    
    mapMOf_ :: Monad m => Getter s a     -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Fold s a       -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Lens' s a      -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Iso' s a       -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Traversal' s a -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Prism' s a     -> (a -> m r) -> s -> m ()
    

  10. mapOf :: ASetter s t a b -> (a -> b) -> s -> t

    lens Control.Lens.Combinators

    Deprecated: Use over

Page 73 of many | Previous | Next