资 源 简 介
Adds static (compile time) checks a-la units of measurements to Haskell basic numerical operators via ad-hoc Num-like typeclass with phantom type parameter encoding unit of measurement. Uses type-level calculation (type-level function) to derive resulting unit of measurement whenever Num operators are used and checks for units mismatch. All the calculation and checks are purely compile-time, phantom type info is absent in run-time so not performance penalty is incurred.