code-ape/rust_length_arithmetic_example

Measure Theory in Rust?

Opened this issue · 1 comments

louy2 commented

It is intuitive to expand the thought of the post into expressing the concept of measure in the type system. This is also hinted by multiplication of lengths resulting in area in the post. Whenever I think of type expression of concepts I go for Hoogle to see if Haskell has already done it, and to my disappointment they have not, although coincidentally a library only for unit conversion is named "Measure" also use nanometer as the base unit of length, but Double as the ratio for conversion.

@louy2: Thank you for your commentary. You're right that my work for the post I did is the beginnings of trying to implement measurements (both conceptually and mathematically) into the type system. I'm surprised to see that no one has taken a more rigorous approach to this with Haskell since it has higher kinded types which should make implementing measurements much easier!