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.