Improve documentation for Real

David Feuer david.feuer at gmail.com
Thu Dec 24 00:42:44 UTC 2020


The Real class has one method:

-- | the rational equivalent of its real argument with full precision

toRational :: a -> Rational

This is ... pretty weird. What does "full precision" mean? For integral and
floating point types, it's fine. It's not at all meaningful for

1. Computable reals
2. Real algebraic numbers
3. Real numbers expressible in radicals
4. Rational numbers augmented with some extra numbers like pi
5. Geometrically constructable reals
6. Etc.

Can we settle on a meaning for toRational?

The properFraction method of the RealFrac class has basically the same
issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20201223/98aff02d/attachment.html>


More information about the Libraries mailing list