News for hackers. Stuff that matters.
Re:Pokémon Go Is Teaching Americans the Metric System by haasn on Saturday July 23, 2016 @09:00PM (#12151720)
Some languages, like Haskell, let you extend the numerical types to whatever representation works well for your causes. A few years ago I wrote a library for embedding units of measure into every figure (at the type level), including e.g. auto-converting between units.

It's somewhat bitrotten but it may still be interesting if you're into this sort of thing: See [1] for an example of how it looks in practice.

[1] https://github.com/haasn/units/blob/master/tests/Tests.hs

There are no comments on this comment yet.