[Haskell-cafe] Re: pi

Henning Thielemann lemming at henning-thielemann.de
Wed Oct 10 14:53:22 EDT 2007

On Wed, 10 Oct 2007, David Roundy wrote:

> On Wed, Oct 10, 2007 at 12:29:07PM +0200, jerzy.karczmarczuk at info.unicaen.fr wrote:
>> ChrisK writes:
>>> There are two things in Floating, the power function (**) [ and sqrt ]
>>> and the transcendental functions (trig functions,exp and log, and
>>> constant pi).
>>> Floating could be spit into two classes, one for the power and one for the
>>> transcendental functions.
>> The power is an abomination for a mathematician. With rational exponent it
>> may generate algebraic numbers, with any real - transcendental... The
>> splitting should be more aggressive. It would be good to have *integer*
>> powers, whose existence is subsumed by the multiplicative s.group structure.
>> But the Haskell standard insists that the exponent must belong to the same
>> type as the base...
> I suppose you're unfamiliar with the (^) operator, which does what you
> describe?
> It seems that you're arguing that (**) is placed in the correct class,
> since it's with the transcendental functions, and is implemented in terms
> of those transcendental functions.  Where is the abomination here?

(**) should not exist, because there is no sensible definition for many 
operands for real numbers, and it becomes even worse for complex numbers. 
The more general the exponent, the more restricted is the basis and vice 
versa in order to get sound definitions.


More information about the Haskell-Cafe mailing list