A typesafe and functional SI units implementation using Mercury typeclasses