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:
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:
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