traverse

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.
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
parTraverse :: Traversable t => Strategy a -> Strategy (t a)
parallel Control.Parallel.Strategies
DEPRECATED: renamed to parTraversable
seqTraverse :: Traversable t => Strategy a -> Strategy (t a)
parallel Control.Parallel.Strategies
DEPRECATED: renamed to evalTraversable