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.
-
lens Control.Lens.Iso mapOf :: ASetter s t a b -> (a -> b) -> s -> tlens Control.Lens.Setter Deprecated: Use over
mapped :: forall (f :: Type -> Type) a b . Functor f => Setter (f a) (f b) a blens Control.Lens.Setter This Setter can be used to map over all of the values in a Functor.
fmap ≡ over mapped fmapDefault ≡ over traverse (<$) ≡ set mapped
>>> over mapped f [a,b,c] [f a,f b,f c]
>>> over mapped (+1) [1,2,3] [2,3,4]
>>> set mapped x [a,b,c] [x,x,x]
>>> [[a,b],[c]] & mapped.mapped +~ x [[a + x,b + x],[c + x]]
>>> over (mapped._2) length [("hello","world"),("leaders","!!!")] [("hello",5),("leaders",3)]
mapped :: Functor f => Setter (f a) (f b) a b
If you want an IndexPreservingSetter use setting fmap.mappingNamer :: (String -> [String]) -> FieldNamerlens Control.Lens.TH Create a FieldNamer from a mapping function. If the function returns [], it creates no lens for the field.
mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)lens Control.Lens.Traversal 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.Traversal 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)
mapMOf :: LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m tlens Control.Lens.Traversal 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)]
mapM ≡ mapMOf 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
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"]
Take into account that async will try to immediately spawn a thread for each element of the Traversable, so running this on large inputs without care may lead to resource exhaustion (of memory, file descriptors, or other limited resources).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"]
Take into account that async will try to immediately spawn a thread for each element of the Traversable, so running this on large inputs without care may lead to resource exhaustion (of memory, file descriptors, or other limited resources).