Unit conversion and manipulation library. http://github.com/jdreaver/quantities

Latest on Hackage:0.4.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD3 licensed and maintained by John David Reaver

A library for creating and manipulating physical quantities, which are a numerical value associated with a unit of measurement. Included is an expression parser and a huge list of predefined quantities with which to parse strings into a Quantity datatype. Once created, a quantity can be converted to different units or queried for its dimensionality. A user can also operate on quantities arithmetically, and doing so uses automatic unit conversion and simplification.


quantities changelog

0.4 (unreleased)

  • Changed type of Quantity to Quantity a, where a is the type of the magnitude. Note that a should be an instance of Floating to get the most out of the available operations on quantities.
  • Added an executable that is an interface to fromString
  • Can use " per " as a synonym for "=>" in fromString

0.3 (4-15-2014)

  • Added unit conversion to fromString using "x => y"
  • Made dimensionality printing nicer.
  • Added doctests and doc coverage tests.

0.2 (4-6-2014)

  • Can handle arithmetical expressions in fromString
  • Added support for user-defined definitions
  • Added check that definitions are the same for conversions

0.1 (3-31-2014)

  • Full implementation of multiplicative dimensional quantities (no offsets yet for temperatures).
  • Support for conversions and monadic quantity computations.
  • Builtin expression parser.
  • Simple definitions file format, fully stocked with units.
  • Travis CI, HSpec units tests, and HLint check.
Used by 2 packages:
comments powered byDisqus