traverse -parallel

traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
base Data.Traversable
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
base Data.Foldable
Map each element of a structure to an action, evaluate these actions from left to right, and ignore the results.
package traverse-with-class
package
This is a generic programming library in the spirit of "Scrap your boilerplate with class", but with several improvements  most notably, it's based on the gtraverse function instead of gfoldl. gtraverse is equivalent in power to gfoldl, but lets you more easily write non-standard views of the data type. Version 0.1.1.1
traverseWithKey :: Applicative t => (Key -> a -> t b) -> IntMap a -> t (IntMap b)
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(n). traverseWithKey f s == fromList $ traverse ((k, v) -> (,) k $ f k v) (toList m) That is, behaves exactly like a regular traverse except that the traversing function also has access to the key associated with a value. > traverseWithKey (\k v -> if odd k then Just (succ v) else Nothing) (fromList [(1, 'a'), (5, 'e')]) == Just (fromList [(1, 'b'), (5, 'f')]) > traverseWithKey (\k v -> if odd k then Just (succ v) else Nothing) (fromList [(2, 'c')]) == Nothing
traverseWithKey :: Applicative t => (k -> a -> t b) -> Map k a -> t (Map k b)
containers Data.Map.Lazy, containers Data.Map.Strict
O(n). traverseWithKey f s == fromList $ traverse ((k, v) -> (,) k $ f k v) (toList m) That is, behaves exactly like a regular traverse except that the traversing function also has access to the key associated with a value. > traverseWithKey (\k v -> if odd k then Just (succ v) else Nothing) (fromList [(1, 'a'), (5, 'e')]) == Just (fromList [(1, 'b'), (5, 'f')]) > traverseWithKey (\k v -> if odd k then Just (succ v) else Nothing) (fromList [(2, 'c')]) == Nothing