c_types: rework groups()

Fixes #236