Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
defaultDefString :: String Source
View the source code for this declaration to see what units and prefixes are defined.
This string holds the definitions for units and prefixes. Base units are
defined by the name of the unit, the name of the base in brackets, and any
aliases for the unit after that, all separated by equal signs: meter =
[length] = m
. Prefixes are defined by placing a dash after all identifiers,
and providing a value for the prefix: milli- = 1e-3 = m-
. Other units are
defined by using previously defined units in an expression: minute = 60 *
second = min
.
The reason these definitions aren't placed in a text file is so you don't have to operate your whole program in the IO monad. Theoretically, a user of this package can create their own definitions file or modify this one, but a mechanism for doing so hasn't been created yet.
These definitions are taken almost verbatim from the Pint unit conversion library for the Python programming language. Check them out on GitHub.