The partition function takes a predicate p and a stream
xs, and returns a pair of streams. The first stream corresponds
to the elements of xs for which p holds; the second stream
corresponds to the elements of xs for which p does not hold.

The group function takes a stream and returns a stream of
lists such that flattening the resulting stream is equal to the
argument. Moreover, each sublist in the resulting stream
contains only equal elements. For example,