[Haskell-cafe] pi

Henning Thielemann lemming at henning-thielemann.de
Wed Oct 10 06:03:33 EDT 2007


On Wed, 10 Oct 2007, Yitzchak Gale wrote:

> Dan Piponi wrote:
>> The reusability of Num varies inversely with how many
>> assumptions you make about it.
>
> A default implementation of pi would only increase usability,
> not decrease it.

As the others have shown, you can compute PI in many ways. Which one is 
appropriate for the general case? Do you have so much types that you want 
to make instances of Floating, that manually defining 'pi' annoys you? Not 
giving a default implementation can even improve code because people have 
to think about a good implementation rather than relying on the default 
one.


More information about the Haskell-Cafe mailing list