2011-04-20

ANNOUNCE: dimensional-0.9

I am pleased to announce version 0.9 of my dimensional library for arithmetic with statically checked physical dimensions. The differences from version 0.8.2.1 is the specification of fixity for *~~ and /~~ and their generalization to operate on functors rather than lists. The lack of fixity specifications was a bug; I had always intended them to have the same fixity as the closely related *~ and /~ (and * and / for that matter).

For readers unfamiliar with the above operators they are used to relate numerical values with units in order to construct and deconstruct physical quantities. For example:

> import Numeric.Units.Dimensional.Prelude
> import qualified Prelude
> x :: Length Double  -- type Length = Quantity DLength
> x = 1 *~ meter
> y :: Double
> y = x /~ kilo meter -- 0.001

This convention for constructing and deconstructing quantities by multiplication and division respectively is motivated by the NIST Guide to the SI, section 7.1.

The *~~ and /~~ operators are analogous to *~ and /~ but operate on functors, e.g.:

> xs :: [Length Double]
> xs = [1..] *~~ meter
> ys :: [Double]
> ys = xs /~~ kilo meter

Finally an observation for the Haskell community: the Haskell package versioning policy does not address fixity changes, which I presume should force a major version change. Unless someone either objects or beats me to it I will update the wiki to reflect this.

Flattr this

No comments:

Post a Comment