[Haskell-cafe] pi

Lennart Augustsson lennart at augustsson.net
Tue Oct 9 18:33:16 EDT 2007


Or 4*atan 1.  But yes, I agree that there could have been a default
definition.
But omitting it seems reasonable too.

On 10/9/07, Jonathan Cast <jonathanccast at fastmail.fm> wrote:
>
> On Tue, 2007-10-09 at 13:07 -0700, Don Stewart wrote:
> > jonathanccast:
> > > I just noticed that pi doesn't have a default definition in the
> standard
> > > prelude, according to the Haddock docs.  Why is this?
> >
> >     $ ghci
> >     Prelude> :t pi
> >     pi :: (Floating a) => a
> >
> >     Prelude> pi
> >     3.141592653589793
> >
> > It's in the Floating class.
>
> Yes.  But it doesn't have a default implementation.  That strikes me as
> odd, considering the mathematical and actual correctness of
>
> class Floating sigma where
>    pi = acos (-1)
>    ...
>
> jcc
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071009/53e463d7/attachment.htm


More information about the Haskell-Cafe mailing list