Get the latest tech news
Scientific computing with confidence using typed dimensions
I have performed non-trivial scientific calculations, in university and beyond, for almost 15 years. Until the end of undergraduate school, this was mostly done by hand.
When implementing numerical routines, I had to pore over the equations (translated to computer expression) countless times, to ensure that they were correctly applied. In this post, I will describe a mechanism, typed dimensions, by which we can eliminate entire classes of bugs, and how the dimensional Haskell package makes this easy. The second (s) for time duration T T; The meter (m) for length L L; The kilogram (kg) for mass M M; The ampere (A) for electric current I I; The kelvin (K) for thermodynamic temperature Θ\Theta; The mole (mol) for amount of substance N N; The candela (cd) for luminous intensity J J.
Or read this on Hacker News