Closed sirinath closed 8 years ago
Why did you close https://github.com/nim-lang/Nim/issues/3252 and open this one, the issues are equivalent?
I was linking initially this can be a feature of distinct but on second thoughts it is better as part of effect to track units and measures.
Next time just edit the issue instead of closing it and creating a new one.
distinct
types in combination with converters work just fine for units of measurements.
Languages like F# (https://msdn.microsoft.com/en-us/library/dd233243.aspx?f=255&MSPPError=-2147217396, http://fsharpforfunandprofit.com/posts/units-of-measure/) and Scala through a library (http://www.squants.com/) have units.
Distinct types are useful mainly when you have the ability to carry the dimensions. Some maybe dimensionless which is the current implementation.
This will be more flexible than my previous proposal: https://github.com/nim-lang/Nim/issues/3252. Also it can be used with distinct types.