Re: [Haskell-cafe] Re: pi

2007-10-11 Thread Jonathan Cast
On Thu, 2007-10-11 at 07:57 +, Aaron Denney wrote: > On 2007-10-11, Jonathan Cast <[EMAIL PROTECTED]> wrote: > > Yes. I am very eager to criticize your wording. To wit, I'm still > > failing to understand what your position is. Is it fair to say that > > your answer to my question, why pi ha

[Haskell-cafe] Re: pi

2007-10-11 Thread Aaron Denney
On 2007-10-11, Jonathan Cast <[EMAIL PROTECTED]> wrote: > Yes. I am very eager to criticize your wording. To wit, I'm still > failing to understand what your position is. Is it fair to say that > your answer to my question, why pi has no default implementation, is `in > fact, pi shouldn't be a m

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Lennart Augustsson
Come on people! This discussion is absurd. The numeric classes in Haskell have a lot of choices that are somewhat arbitrary. Just live with it. If pi has a default or not has no practical consequences. -- Lennart ___ Haskell-Cafe mailing list Haske

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread ok
On 11 Oct 2007, at 1:34 pm, Dan Weston wrote: Actually, [pi] is a constant: piDecimalExpansion :: String. No, that's another constant. A translation from piDecimalExpansion :: String to pi :: Floating a => a is already well defined via read :: Read a => String -> a Wrong. piDecimalExpan

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Dan Weston
Dan Weston wrote: David Benbennick wrote: On 10/10/07, Dan Weston <[EMAIL PROTECTED]> wrote: Actually, it is a constant: piDecimalExpansion :: String. Where is this constant defined? A translation from piDecimalExpansion :: String to pi :: Floating a => a is already well defined via read ::

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Dan Weston
David Benbennick wrote: On 10/10/07, Dan Weston <[EMAIL PROTECTED]> wrote: Actually, it is a constant: piDecimalExpansion :: String. Where is this constant defined? A translation from piDecimalExpansion :: String to pi :: Floating a => a is already well defined via read :: Read a => String -

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread David Benbennick
On 10/10/07, Dan Weston <[EMAIL PROTECTED]> wrote: > Actually, it is a constant: piDecimalExpansion :: String. Where is this constant defined? > A translation from piDecimalExpansion :: String to pi :: Floating a => a > is already well defined via read :: Read a => String -> a > > Any definition

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Dan Weston
Actually, it is a constant: piDecimalExpansion :: String. A translation from piDecimalExpansion :: String to pi :: Floating a => a is already well defined via read :: Read a => String -> a Any definition of pi in the Floating class that differs from (read piDecimalExpansion) is erroneous. I p

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Jonathan Cast
On Wed, 2007-10-10 at 12:29 +0200, [EMAIL PROTECTED] wrote: > ChrisK writes: > > > Putting 'pi' in the same class as the trigonometric functions is good > > design. > > If you wish so... But: > Look, this is just a numeric constant. > Would you like to have e, the Euler's constant, etc., as wel

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread ok
Someone wrote about pi: | But it is just a numerical constant, no need to put it into a class, and nothing to do with the type_classing of related functions. "e" is not std. defined, and it doesn't kill people who use exponentials. But it *isn't* "A" numerical constant. It is a *different* c

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread ok
Let's be clear what we are talking about, because I for one am getting very confused by talk about "putting PI into FLoating as a class member serves nobody" when it already IS there. From the report: class (Fractional a) => Floating a where pi :: a exp, log, sqrt :: a -> a (**), logBase :

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread David Roundy
On Wed, Oct 10, 2007 at 10:52:36PM +0200, [EMAIL PROTECTED] wrote: > >... Where is the abomination here? > > Having THREE different power operators, one as a class member, others as > normal functions. Do you think this is methodologically sane? It's a bit odd, but I prefer it to having one hype

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread David Roundy
On Wed, Oct 10, 2007 at 10:32:55PM +0200, Henning Thielemann wrote: > On Wed, 10 Oct 2007, David Roundy wrote: > > I think it's quite sensible, for instance, that passing a negative > >number as the first argument of (**) with the second argument > >non-integer leads to a NaN. > > It would bette

[Haskell-cafe] Re: pi

2007-10-10 Thread jerzy . karczmarczuk
David Roundy: jerzy.karczmarczuk: 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

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Andrew Coppin
Henning Thielemann wrote: It would better to disallow negative bases completely for (**), because integers should be explicitly typed as integers and then (^^) can be used. I have already seen (x**2) and (e ** x) with (e = exp 1) in a Haskell library. Even better would be support for statical

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Henning Thielemann
On Wed, 10 Oct 2007, David Roundy wrote: On Wed, Oct 10, 2007 at 08:53:22PM +0200, Henning Thielemann wrote: On Wed, 10 Oct 2007, David Roundy wrote: It seems that you're arguing that (**) is placed in the correct class, since it's with the transcendental functions, and is implemented in term

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread David Roundy
On Wed, Oct 10, 2007 at 08:53:22PM +0200, Henning Thielemann wrote: > On Wed, 10 Oct 2007, David Roundy wrote: > >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.

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Henning Thielemann
On Wed, 10 Oct 2007, Henning Thielemann wrote: (**) 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

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Henning Thielemann
On Wed, 10 Oct 2007, David Roundy wrote: On Wed, Oct 10, 2007 at 12:29:07PM +0200, [EMAIL PROTECTED] 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

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread Isaac Dupree
David Roundy wrote: On Wed, Oct 10, 2007 at 12:29:07PM +0200, [EMAIL PROTECTED] 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,

Re: [Haskell-cafe] Re: pi

2007-10-10 Thread David Roundy
On Wed, Oct 10, 2007 at 12:29:07PM +0200, [EMAIL PROTECTED] 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

[Haskell-cafe] Re: pi

2007-10-10 Thread Aaron Denney
On 2007-10-10, [EMAIL PROTECTED] wrote: > Oh yes, everybody in the world uses in ONE program several overloaded > versions of pi, of the sine function, etc. They don't have to be in the same program for overloaded versions to be semantically useful. They're not strictly necessary, but so? Having

[Haskell-cafe] Re: pi

2007-10-10 Thread Aaron Denney
On 2007-10-10, [EMAIL PROTECTED] wrote: > ChrisK writes: > >> Putting 'pi' in the same class as the trigonometric functions is good design. > > If you wish so... But: > Look, this is just a numeric constant. > Would you like to have e, the Euler's constant, etc., as well, polluting > the name spac

[Haskell-cafe] Re: pi

2007-10-10 Thread jerzy . karczmarczuk
ChrisK writes: Putting 'pi' in the same class as the trigonometric functions is good design. If you wish so... But: Look, this is just a numeric constant. Would you like to have e, the Euler's constant, etc., as well, polluting the name space? What for? Moving smoothly from single to double

[Haskell-cafe] Re: pi

2007-10-10 Thread ChrisK
[EMAIL PROTECTED] wrote: > Yitzchak Gale writes: >> 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. > > Suppose I believe you. (Actually, I am afra