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

Add constants Length.meter, Angle.degree, Duration.second etc.? #13

Closed
ianmackenzie opened this issue Oct 12, 2018 · 1 comment
Closed

Comments

@ianmackenzie
Copy link
Owner

For example, Length.meter would be equal to Length.meters 1. This would be convenient for setting up rates of change like

Pixels.pixels 96 |> Quantity.per Length.inch

instead of

Pixels.pixels 96 |> Quantity.per (Length.inches 1)

However, it would be a fair bit of extra noise in the API if it was adopted for all units, and it's not clear how it would work where there's no distinction between singular and plural forms (such as with Length.thou and Power.mechanicalHorsepower). And the current form has the advantage of making it obvious that you can pass any quantity value as the denominator to Quantity.per.

@ianmackenzie
Copy link
Owner Author

Seems to have several drawbacks for not much of an improvement - will close this for now.

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

No branches or pull requests

1 participant