[Haskell-cafe] pi

jerzy.karczmarczuk at info.unicaen.fr jerzy.karczmarczuk at info.unicaen.fr
Wed Oct 10 09:16:30 EDT 2007

Jules Bean writes: 

> jerzy.karczmarczuk:
>> Somehow I do not only think that the default implementation would be good
>> for nothing, but that putting PI into Floating as a class member, serves
>> nobody.
> Are you aware that it already is in the Floating class?

A very interesting question. What do you think: do I know it or not,
in view of the preceding discussion? 

> This discussion is not about adding it, but about whether or not it should 
> have a default.
> Are you suggesting pi should be removed from the Floating class?
> Then, what type would you give pi?

First, I don't care whether it is there or not. When I use it, I define
a particular instance (double, a constant formal series, a constant element
of some differential algebra I enjoy personally, etc. No default would
help me anyway). 

And then, I give it the type it deserves. 

> Given that pi is often used with sin, as in "sin (t * pi)" it would seem 
> very odd if pi forced that to be monomorphic:

Oh yes, everybody in the world uses in ONE program several overloaded
versions of pi, of the sine function, etc. Well, perhaps not everybody,
for example I don't. And I use numerics quite often.
How often *you* needed simultaneously overloaded pi and trigs in such a way
that a default could help you? Answer sincerely (if you wish to answer at

Jerzy Karczmarczuk 

More information about the Haskell-Cafe mailing list