2014-02-11

Numtype(-tf) and dimensional(-tf) updated for GHC 7.8.1

My numtype and numtype-tf libraries both needed one line changes to be compatible with the GHC 7.8.1 release candidate. Versions 1.1 and 0.1.2 (respectively) have been uploaded to hackage.

The update to numtype also necessitated an update to dimensional, mainly to bump the upper bounds of the numtype dependency, but a few API additions snuck in too. The change log for the new version (0.12.3), as well as the other versions that have been uploaded to hackage since my previous version announcement can be found at the bottom of this post.

Dimensional-tf didn’t need an update for GHC 7.8 but has been updated with the same API additions as dimensional.

Dimensional’s changelog

0.13 (2014-02)

  • Bump numtype dependency to 1.1 (GHC 7.8.1 compatibility fix).
  • Added Torque.
  • Added D.. for the type synonym quantities (e.g., Angle).

0.12.2 (2013-11)

  • Added FirstMassMoment, MomentOfInertia, AngularMomentum.
  • Improved unit numerics.

0.12.1 (2013-07)

  • Typeable Dimensionals.

0.12 (2013-06)

  • Polymorphic _0 (closes issue 39).
  • Added astronomicalUnit.
  • Added imperial volume units.
  • Added ‘mil’ (=inch/1000).
  • Added tau.
  • Added KinematicViscosity.

0.10.1.2 (2011-09)

  • Bumped time dependency to < 1.5.

0.10.1.2 (2011-08)

  • Bumped time dependency to < 1.4.

0.10.1 (2011-08)

GHC 7.2.1 compatibility fix:

  • Increased CGS context-stack to 30.

2014-02-09

Joy and caution with -XNegativeLiterals in GHC 7.8

The new NegativeLiterals extension in GHC 7.8 scratches an itch I have had for a long time. Namely:

> y = (-41940.917505092) *~ kilo meter

With NegativeLiterals users of dimensional can finally write:

> y = -41940.917505092 *~ kilo meter

Thanks GHC HQ and contributors!

However, be careful so the extension doesn’t break your calculations. Here is an example (not using dimensional) of how you could get bitten. Without NegativeLiterals:

> Prelude> -2 ^ 2
> -4

With NegativeLiterals:

> Prelude> -2 ^ 2
> 4

I certainly prefer the latter behaviour, but having some regression tests in place when enabling NegativeLiterals might be a good idea.