Re: Revamping the numeric classes

2001-02-07 Thread Ch. A. Herrmann
moved to haskell-cafe Ketil E.g. way back, I wrote a simple differential equation solver. Ketil Now, the same function *could* have been applied to vector Ketil functions, except that I'd have to decide on how to implement Ketil all the "Num" stuff that really didn't fit well.

Re: Show, Eq not necessary for Num [Was: Revamping the numeric classes]

2001-02-07 Thread Jerzy Karczmarczuk
"Ch. A. Herrmann" answers my questions: Jerzy What do you mean "predefined" operators? Predefined where? In hugs, ":t (*)" tells you: (*) :: Num a = a - a - a which is an intended property of Haskell, I suppose. Aha. But I would never call this a DEFINITION of this operator. This

(no subject)

2001-02-07 Thread Dylan Thurston
___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Revamping the numeric classes

2001-02-07 Thread Marcin 'Qrczak' Kowalczyk
07 Feb 2001 11:47:11 +0100, Ketil Malde [EMAIL PROTECTED] pisze: If it is useful to have a fine granularity of classes, you can imagine doing: class Multiplicative a b c where (*) :: a - b - c Then a*b*c is ambiguous no matter what are types of a,b,c and the

Re: Revamping the numeric classes

2001-02-07 Thread Dylan Thurston
Other people have been making great points for me. (I particularly liked the example of Dollars as a type with addition but not multiplication.) One point that has not been made: given a class setup like class Additive a where (+) :: a - a - a (-) :: a - a - a negate :: a - a zero :: a

Re: Revamping the numeric classes

2001-02-07 Thread andrew
On Wed, Feb 07, 2001 at 11:47:11AM +0100, Ketil Malde wrote: "Ch. A. Herrmann" [EMAIL PROTECTED] writes: [...] the problem is that the --majority, I suppose?-- of mathematicians tend to overload operators. They use "*" for matrix-matrix multiplication as well as for matrix-vector

RE: Revamping the numeric classes

2001-02-07 Thread Peter Douglass
I have some questions about how Haskell's numeric classes might be revamped. Is it possible in Haskell to circumscribe the availability of certain "unsafe" numeric operations such as div, /, mod? If this is not possible already, could perhaps a compiler flag "-noUnsafeDivide" could be added

Re: Revamping the numeric classes

2001-02-07 Thread Tom Pledger
Dylan Thurston writes: : | (A question in the above context is whether the literal '0' should | be interpreted as 'fromInteger (0::Integer)' or as 'zero'. | Opinions?) Opinions? Be careful what you wish for. ;-) In a similar discussion last year, I was making wistful noises about