zipWith package:containers

zipWith generalizes zip by zipping with the function given as the first argument, instead of a tupling function. For example, zipWith (+) is applied to two sequences to take the sequence of corresponding sums.
When a key is found in both maps, apply a function to the key and values to produce an action and use its result in the merged map.
When a key is found in both maps, apply a function to the key and values and use the result in the merged map.
zipWithMatched
:: (Key -> x -> y -> z)
-> SimpleWhenMatched x y z
When a key is found in both maps, apply a function to the key and values, perform the resulting action, and maybe use the result in the merged map. This is the fundamental WhenMatched tactic.
When a key is found in both maps, apply a function to the key and values and maybe use the result in the merged map.
zipWithMaybeMatched
:: (Key -> x -> y -> Maybe z)
-> SimpleWhenMatched x y z
When a key is found in both maps, apply a function to the key and values and use the result in the merged map.
zipWithMatched :: (k -> x -> y -> z)
-> SimpleWhenMatched k x y z
When a key is found in both maps, apply a function to the key and values, perform the resulting action, and maybe use the result in the merged map. This is the fundamental WhenMatched tactic.
When a key is found in both maps, apply a function to the key and values and maybe use the result in the merged map.
zipWithMaybeMatched :: (k -> x -> y -> Maybe z)
-> SimpleWhenMatched k x y z
When a key is found in both maps, apply a function to the key and values to produce an action and use its result in the merged map.
When a key is found in both maps, apply a function to the key and values and use the result in the merged map.
zipWithMatched :: (k -> x -> y -> z)
-> SimpleWhenMatched k x y z
When a key is found in both maps, apply a function to the key and values, perform the resulting action, and maybe use the result in the merged map. This is the fundamental WhenMatched tactic.
When a key is found in both maps, apply a function to the key and values and maybe use the result in the merged map.
zipWithMaybeMatched :: (k -> x -> y -> Maybe z)
-> SimpleWhenMatched k x y z
When a key is found in both maps, apply a function to the key and values, perform the resulting action, and maybe use the result in the merged map. This is the fundamental WhenMatched tactic.
zipWith3 takes a function which combines three elements, as well as three sequences and returns a sequence of their point-wise combinations, analogous to zipWith.
zipWith4 takes a function which combines four elements, as well as four sequences and returns a sequence of their point-wise combinations, analogous to zipWith.
Unzip a sequence using a function to divide elements.
unzipWith f xs == unzip (fmap f xs)
Efficiency note: unzipWith produces its two results in lockstep. If you calculate unzipWith f xs and fully force either of the results, then the entire structure of the other one will be built as well. This behavior allows the garbage collector to collect each calculated pair component as soon as it dies, without having to wait for its mate to die. If you do not need this behavior, you may be better off simply calculating the sequence of pairs and using fmap to extract each component sequence.