Consider reordering the type params of ConvertTz
hsfzxjy opened this issue · comments
Xie Jingyi commented
Currently ConvertTz
has the following signature:
func ConvertTz[T TimeZone, U TimeZone](from Time[T]) Time[U]
Users have to specify both T and U at every call site like ConvertTz[T, U](...)
. However, if we change it to
func ConvertTz[U TimeZone, T TimeZone](from Time[T]) Time[U] // note that U and T are swapped
Users can simply call with ConvertTz[U](...)
and let T
be inferred from input arguments, which improves the ergnomics.