[Haskell-cafe] instance Enum Double considered not entirely great?

Brandon Allbery allbery.b at gmail.com
Wed Sep 21 03:15:14 CEST 2011


On Tue, Sep 20, 2011 at 17:56, Evan Laforge <qdunkan at gmail.com> wrote:

> > I actually think the brokenness of Ord for floating point values is
> > worse in many ways, as demonstrated by the ability to insert a value
> > into a Data.Set.Set and have other values "disappear" from the set as
>
> Whoah, that's scary.  What are some examples of this happening?  Does
> this mean it's unsafe to store Doubles in a Map?


It's unsafe to use them as a key ((Set a) being effectively (Map a ())), but
that should be pretty obvious anyway given that (==) isn't reliable for
Double.

-- 
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110920/fd7307d8/attachment.htm>


More information about the Haskell-Cafe mailing list