adelhult / hypatia

Domain-specific language for units and arithmetic calculations
https://adelhult.github.io/hypatia
2 stars 0 forks source link

Custom prefix declaration #8

Closed adelhult closed 2 years ago

adelhult commented 2 years ago

Currently all units can also be used with a metric (or binary) prefix like "km" and "kilometer". However, it would be nicer if units / quantifiers could be declared in the prelude instead of baked into the language. This would also lower the chance of name collisions because we can avoid having things like "centijoul" which never will be used.

Something like this perhaps:

prefix kilo k = 1000

prefixgroup foo = (kilo) 

unit bar using foo
adelhult commented 2 years ago

Implemented in main