Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider reordering the type params of ConvertTz #28

Closed
hsfzxjy opened this issue Dec 12, 2023 · 0 comments · Fixed by #29
Closed

Consider reordering the type params of ConvertTz #28

hsfzxjy opened this issue Dec 12, 2023 · 0 comments · Fixed by #29

Comments

@hsfzxjy
Copy link
Contributor

hsfzxjy commented Dec 12, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant