▲ | aithrowawaycomm 4 days ago | |
I have yet to see a language which does units better than F#: https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref... It is one of the main reasons I use F# over other functional languages. Doing it within an existing type system is more trouble than it’s worth: the algebra of units is simple, but it doesn’t apply to other types without stretching the compiler. It is far easier to have a distinct subsystem with measure types specifically identified. |