[Haskell-cafe] Exception for NaN

KQ quick at sparq.org
Sat May 14 18:25:46 CEST 2011


On Sat, 14 May 2011 06:14:31 -0700, Ketil Malde <ketil at malde.org> wrote:

> Daniel Fischer <daniel.is.fischer at googlemail.com> writes:
>
>> Not having Eq and Ord instances for Double and Float would be extremely
>> inconvenient (too inconvenient to seriously consider, I think), so one can
>> a) do what's done now
>> b) make NaNs an error
>> c) come up with a brilliant solution.
>
> Maybe not terribly brilliant, but wouldn't it improve things slightly if
> NaN was considered less or greater than any other value (possibly
> excluding infinities)?
>
> -k

It has a certain aesthetic appeal, but another concern of this approach would be non-termination.  This is perhaps less of a concern for functional methodologies, but still a danger for algorithms that assume total ordering.

-- 
-KQ



More information about the Haskell-Cafe mailing list