-1

This function divides a sequence into partitions, where a partition is a list of consecutive matching elements.
Example
Input: (A, A, B, B, B, A, C, C)
Output: ((A, A), (B, B, B), (A), (C, C))
I've tried to make this code "obviously correct", but it still doesn't look that way to ...