[Haskell-cafe] Haskell.org GSoC - Units
lemming at henning-thielemann.de
Wed Feb 18 17:02:46 EST 2009
On Tue, 17 Feb 2009, Sterling Clover wrote:
> Something that hit me tonight: Last GSoC gave us GHC compiler plugins.
Never heard of it. Sometimes I thought it would be nice to modify or
extend GHCs error messages by libraries in order make they feel more like
domain specific languages. E.g. instead of or additionally to saying 'type
A infered, but type B expected' it could state 'you have probably made the
common error to use function f instead of (uncurry f)'. Is this possible
with compiler plugins?
> Plugins, in essence, as I understand them, let us extend the type system
> in useful ways. Haskell has libraries for units, but no lightweight
> (i.e. without simulated dependent types or a dsl) way to embed units in
> Haskell calculations. Units in a functional language are possible, and
> implemented in, e.g., F# 
I think units as separate extensions are not a good goal. The type system
should be made strong enough to handle this application without hassle.
>  http://hackage.haskell.org/cgi-bin/hackage-scripts/package/dimensional,
There is also both dynamic and static unit checking in NumericPrelude:
More information about the Haskell-Cafe