[Haskell-cafe] Statically tracking "validity" - suggestions?

Vo Minh Thu noteed at gmail.com
Tue Aug 31 14:30:54 EDT 2010


2010/8/31 Andrew Coppin <andrewcoppin at btinternet.com>:
> Luke Palmer wrote:
>>
>> I have a description of the design pattern you need, appropriately
>> named:
>> http://lukepalmer.wordpress.com/2009/03/24/certificate-design-pattern/
>>
>
> Mmm, I like that.
>
> There are two small problems:
>
> * In my web browser, some of the code snippets get the right-hand edge
> chopped off.
>
> * Double-precision floating-point arithmetic is inexact, so half your code
> won't actually work in the real world. (But obviously, it's only supposed to
> be an example for illustration purposes.)
>
> With regard to the second, does anybody know of anything on Hackage for
> testing whether two values are "approximately equal"? It must be a common
> programming problem, and it's more tricky than you think to solve it well.

I think something has been added to Hackage recently about that.

There is this one, but I don't know if it is the one I was thinking about.
http://hackage.haskell.org/package/ieee

Cheers,
Thu


More information about the Haskell-Cafe mailing list