goldfirere / units-defs

Public repo for the units-defs package of well-typed unit definitions.
13 stars 10 forks source link

Add Data.Metrology.Time #4

Closed jcristovao closed 10 years ago

jcristovao commented 10 years ago

@spl suggested that we add Minutes, Hours, etc to units-defs.

What do you think?

Given that they are neither SI or Imperial, I would say add them on a different hierarchy, perhaps Data.Metrology.Time?

goldfirere commented 10 years ago

Yes, please -- Data.Metrology.Time seems like the right place. I don't think, though, that the module should contain Year, because that's ambiguous. (Similar, but worse, for Month.) I would love to come up with a good way of dealing with conversions that do not have a constant conversion factor (equally applicable to days vs. years as to dollars vs. euros), too.

spl commented 10 years ago

Non-SI units accepted for use with the SI, and units based on fundamental constants

goldfirere commented 10 years ago

Given that link (thanks, @spl) perhaps this could be done in the SI hierarchy.

jcristovao commented 10 years ago

@spl , nice catch, I did not know that.

I'll do the pull request accordingly, today or tomorrow.

spl commented 10 years ago

If you prefer to distinguish such units, you could use a Derived module or something like that.

jcristovao commented 10 years ago

So, I followed @spl suggestion of using a ...units.derived module, but then to keep things coherent, I would also have to move litre from units. What do you say @goldfirere ?

goldfirere commented 10 years ago

Eh. I think the principal difference between those "derived" units and the proper SI units is that the derived units have conversion factors other than 1. But, since the library makes it so that users don't need to worry about this distinction, I don't see the need to put the units in a separate module. We could be clear in the source file (as we are with Liter) but that's enough of a distinction for my taste.

I'm happy to go with another opinion though.

goldfirere commented 10 years ago

Closed with merging #6.