goldfirere / units-defs

Public repo for the units-defs package of well-typed unit definitions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Data.Metrology.Time

jcristovao opened this issue · comments

@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?

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.

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

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

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

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

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 ?

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.

Closed with merging #6.