[Haskell-cafe] [Haskell] [ANN] quantities 0.3.0
hsyl20 at gmail.com
Tue Apr 15 22:02:40 UTC 2014
2014-04-15 22:54 GMT+02:00 Auke Booij <auke at tulcod.com>:
> On 15 April 2014 21:30, John David Reaver <jdreaver at adlerhorst.com> wrote:
> > Using the type system to handle units is incorporated into some
> > other libraries. I couldn't find a library that parses units from
> > strings, so I made one. I certainly plan to add this
> > functionality in the future.
> so then why are you reinventing those units libraries? in other words,
> why did you write Quantity instead of reusing a similar data type from
> an existing library?
Most libraries only support static checking of units (AFAIK). Supporting
unit parsing from a string is great. When we will rewrite Google with
Haskell, we will need it ;) (try to type "(1m + 1ft + 2 yards + 50in) * 5 /
(8 km/h) in minutes" for instance).
You cannot ask him why his library only supports string input, then ask him
to provide an additional Haskell DSL that is not unsafe and finally
reproach him for wanting to support both approaches. For his needs (at
least in the Python GUI app he describes), he can either use an external
DSL approach (parsing strings) or use an Haskell EDSL with
System.Eval.Haskell (or an equivalent). The former may be preferred.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe