Re: [Haskell-cafe] Why does the class called Real support only rationals, and not all reals?

2007-06-04 Thread bretm
Awesomely complete response. Thank you. Henning Thielemann wrote: There are several things that are inconvenient in the numeric part of Haskell 98 Prelude. As always I suggest a look at alternative numeric class hierarchies, like NumericPrelude:

Re: [Haskell-cafe] Why does the class called Real support only rationals, and not all reals?

2007-06-04 Thread bretm
DavidA-2 wrote: Yes, I'm afraid that you are understanding correctly. Annoying isn't it. It is well-known (among Haskell mathematicians at least) that the numeric type classes in the prelude are broken. Here's one proposal for a small step in the right direction:

[Haskell-cafe] Why does the class called Real support only rationals, and not all reals?

2007-06-03 Thread bretm
I just got started learning Haskell a few days ago. I've implemented a numeric data type that can represent some irrational numbers exactly, and I'd like to instantiate the RealFrac class so I can do truncate, round, etc., in the most natural way in the language. Implementing properFraction