r/purescript • u/fluffynukeit • Jan 17 '15
ANN: purescript-units
Hi, purescripters. Recently I've been working on a library for runtime unit checking. Compile time unit checking is pretty cool, too, but I've found that it can sometimes be hard to work with unless all the calculations are defined at compile time.
Module is here.
This library is mostly a practice exercise for something I can foresee wanting in the near future, and my searches didn't find any similar library. I'd be very open to code review/API suggestions!
Also, the API would probably be significantly simplified and more flexible if PS supported fromRational, so maybe we'll see that eventually. :)
View all comments
Show parent comment
1
u/fluffynukeit Jan 18 '15
Thanks! I think eventually I'd really like to try a hybrid approach that is both able to ready dimensions from IO but also statically check most of the calculation chain so there's no overhead of frequent dimension verification. Not sure what such an approach would look like, though.