This function compares adjacent elements of a list. If two adjacent
elements satisfy a relation then they are put into the same sublist.
Example:
>>> groupBy (<) "abcdebcdef"
["abcde","bcdef"]
In contrast to that
groupBy compares the head of each sublist
with each candidate for this sublist. This yields
>>> List.groupBy (<) "abcdebcdef"
["abcdebcdef"]
The second
b is compared with the leading
a. Thus it is put into the same sublist as
a.
The sublists are never empty. Thus the more precise result type would
be
[(a,[a])].