Not sure if this helps, but here an example:
The Complex type (at the Standard Math/complex pure library) used to be a
tuple, and was upgraded to a generic object. There are two possible
representations of a complex number: rectangular and polar. The library and
most functions are based on the Rectangular representation; however, there is a
conversion to the Polar representation whose output is still a tuple:
proc polar[T](z: Complex[T]): tuple[r, phi: T]
proc rect[T](r, phi: T): Complex[T]
Run
I believe that a generic Polar type should have been defined for consistency,
to allow:
proc polar[T](z: Complex[T]): Polar[T]
proc rect[T](p: Polar[T]): Complex[T]
Run
In such a way, Polar and Complex types can be used the same way.