You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if Numbat supported unit lists out of the box à la Gnu Units. This allows units to be displayed in an effectively arbitrary "base" consisting of other units.
I understand that this may be tricky or conceptually incompatible with unit typing, but maybe it could make sense to have some short-hand to define unit list functions that convert to String. I'm thinking of something similar to the human() time function, which currently does this manually in a pretty janky way. (Perhaps the real issue is that custom functions don't have the greatest ergonomics; I'll start a discussion expanding on that.)
Could be nice to have proper support for unit lists as typed entities, though I haven't put much thought into whether that makes sense.
The text was updated successfully, but these errors were encountered:
Qalculate calls this feature "mixed units". You can convert heights to "feet + inch" and times to "hours + minutes + seconds", etc.
I agree it would be nice to support this out-of-the-box, without having to write functions like human.
this may be tricky or conceptually incompatible with unit typing
Good thing Numbat is not based on "unit types", but on "dimension types" 😄 [1] [2]. But seriously: I don't think our type system is going to be the problem. If anything, it helps. It makes sense to convert a height to [feet, inch] where all units are of type Length. Or a time to [hours, minutes, seconds] where all units are of type Time. It does not make sense to convert a length to, say, [feet, second].
Concerning syntax, I'm thinking we could do one of the following
length -> [feet, inch]
length -> feet + inch
The latter might be more intuitive, but the former makes more sense from a language-design perspective, I believe.
It would be great if Numbat supported unit lists out of the box à la Gnu Units. This allows units to be displayed in an effectively arbitrary "base" consisting of other units.
I understand that this may be tricky or conceptually incompatible with unit typing, but maybe it could make sense to have some short-hand to define unit list functions that convert to
String
. I'm thinking of something similar to thehuman()
time function, which currently does this manually in a pretty janky way. (Perhaps the real issue is that custom functions don't have the greatest ergonomics; I'll start a discussion expanding on that.)Could be nice to have proper support for unit lists as typed entities, though I haven't put much thought into whether that makes sense.
The text was updated successfully, but these errors were encountered: