realToFrac issues

John Meacham john at
Mon Feb 27 21:07:37 EST 2006

On Mon, Feb 27, 2006 at 05:50:38PM -0800, Ashley Yakeley wrote:
> >The proposed solution was to add NaN, +Infinity, and -Infinity to
> >rational with the representations 0 :% 0, 1 :% 0, and -1 :% 0
> >respectively. Seems straightforward, (and generally useful) but we
> >should make sure not to forget it for haskell-prime. 
> I'm not necessarily against this, but it does fundamentally change the 
> semantics of Ratio. Has all the behaviour been worked out for this?

Well, another solution would be to define some other mechanism for
converting between floating type numbers. but I would find extra
expresiveness of adding NaN,etc.. to Ratio quite useful, as propagating
infinities seems like a much more user friendly behavior than bottoming
out. It is a fairly large change, but since all currently correct
haskell programs don't create rationals with zero denominators, none of
their behavior will change.

I hesitate to bring it up because I fear that if we look at haskells
floating point support too much we might realize just how bad it is and
how tricky these things are to get right and grow despondent :)


John Meacham - ⑆⑆john⑈

More information about the Haskell-prime mailing list