Partition a list.