-
Notifications
You must be signed in to change notification settings - Fork 17
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
Dynamic prefix selection #163
Comments
That split into |
Another possible concern here is that Should we have variants that exclude them from the search? |
I think we should, perhaps even allowing users to provide their own assoc list of prefixCandidates appropriate to the field. For example, in addition to never having seen dekameters or hektometers it might be rare in a field to go beyond kilometers, preferring, e.g., 42164 km over 42.164 Mm. |
Good idea. |
Should these be lists of |
I went with the third thing. It seems cleaner because otherwise |
I want to fix this as the next order of business. @bjornbm do you have suggestions for what predefined
|
I can't think of any sensible ones other than |
I'd like to be able to display a
Length Double
by automatically selecting an appropriate metric prefix formeter
based on the value of theLength Double
rather than requiring a static selection of prefix.As far as I can tell, we don't have support for this. Now that we have reified
Prefix
es, a list ofsiPrefixes
, and theapplyPrefix
function (https://github.com/bjornbm/dimensional/blob/master/src/Numeric/Units/Dimensional/SIUnits.hs#L112-L116) we are close, we just need a function to select the correct prefix.Proposed interface: (the
Floating
context being required to accesslogBase
andRealFrac
being required fortruncate
)We could possibly also expose:
where
Are there any reasons why this is undesirable? Are these names any good?
The text was updated successfully, but these errors were encountered: