typelevel / squants

The Scala API for Quantities, Units of Measure and Dimensional Analysis
https://www.squants.com
Apache License 2.0
922 stars 122 forks source link

Singular versions of natural-language-style converters #38

Open nornagon opened 10 years ago

nornagon commented 10 years ago

For cases like 1 minute.

nornagon commented 10 years ago

I did this for times in transcriptic/squants@e72684c6, but there's a lot more to be done for the other units.

garyKeorkunian commented 10 years ago

Yes, I was torn over offering conversions like these as it seemed a bit redundant to the singular value minute that already exists. My initial intent was to offer the singular term for cross-type ratios:

val speed = 10.meters / minute

Quantities of singular amount can be created with val time = 1 minutes or val time = minute which I agree is not quite as natural as it could be.

The only downside I see is the effort, but I do think it is worth doing.

nornagon commented 10 years ago

(whoops.)