The
partition function takes a predicate
p and a
stream
xs, and returns a pair of lists. The first list
corresponds to the elements of
xs for which
p holds;
the second corresponds to the elements of
xs for which
p does not hold.
'partition' p xs = ('filter' p xs, 'filter' (not . p) xs)