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

2001-02-09 Thread Ketil Malde
Brian Boutel [EMAIL PROTECTED] writes: The fact that equality can be trivially defined as bottom does not imply that it should be a superclass of Num, it only explains that there is an ugly way of working around the problem. There is nothing trivial or ugly about a definition that reflects

In hoc signo vinces (Was: Revamping the numeric classes)

2001-02-09 Thread Jerzy Karczmarczuk
Marcin 'Qrczak' Kowalczyk wrote: JK Now, signum and abs seem to be quite distincts beasts. Signum seem JK to require Ord (and a generic zero...). Signum doesn't require Ord. signum z = z / abs z for complex numbers. Thank you, I know. And I ignore it. Calling "signum" the result of

Re: Revamping the numeric HUMAN ATTITUDE

2001-02-09 Thread Jerzy Karczmarczuk
Brian Boutel wrote: William Lee Irwin III wrote: The Standard Prelude serves its purpose well and accommodates the largest cross-section of users. Perhaps a Geek Prelude could accommodate the few of us who do need these sorts of schenanigans. Amen. Aha. And we will have The

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

2001-02-09 Thread Marcin 'Qrczak' Kowalczyk
Fri, 9 Feb 2001 11:48:33 -0500, Dylan Thurston [EMAIL PROTECTED] pisze: class (Show a, Read a, Eq a) = Comfortable a instance (Show a, Read a, Eq a) = Comfortable a Why isn't it legal? Because in Haskell 98 instance's head must be of the form of a type constructor applied to type

Re: 'Convertible' class?

2001-02-09 Thread Dylan Thurston
On Fri, Feb 09, 2001 at 12:05:09PM -0500, Dylan Thurston wrote: On Thu, Feb 08, 2001 at 04:06:24AM +, Marcin 'Qrczak' Kowalczyk wrote: You can put Num a in some instance's context, but you can't put Convertible Integer a. It's because instance contexts must constrain only type

Re: In hoc signo vinces (Was: Revamping the numeric classes)

2001-02-09 Thread William Lee Irwin III
Fri, 09 Feb 2001 10:52:39 +, Jerzy Karczmarczuk pisze: Again, a violation of the orthogonality principle. Needing division just to define signum. And of course a completely different approach do define the signum of integers. Or of polynomials... On Fri, Feb 09, 2001 at 07:19:21PM +,

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

2001-02-09 Thread Brian Boutel
Ketil Malde wrote: Brian Boutel [EMAIL PROTECTED] writes: - Having a class hierarchy at all (or making any design decision) implies compromise. I think the argument is that we should move Eq and Show *out* of the Num hierarchy. Less hierarchy - less compromise. Can you demonstrate

Re: Haskell Implemetors Meeting

2001-02-09 Thread John Meacham
Another Haskell - Haskell transformation tool which I always thought would be useful (and perhaps exists?) would be a Haskell de-moduleizer. Basically it would take a Haskell program and follow its imports and spit out a single monolithic Haskell module. My first thought is that this should be

Re: Instances of multiple classes at once

2001-02-09 Thread Fergus Henderson
On 08-Feb-2001, Dylan Thurston [EMAIL PROTECTED] wrote: On Thu, Feb 08, 2001 at 09:41:56PM +1100, Fergus Henderson wrote: One point that needs to be resolved is the interaction with default methods. Consider class foo a where f :: ... f = ...

Re: Revamping the numeric classes

2001-02-09 Thread Fergus Henderson
On 08-Feb-2001, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote: I don't like the idea of treating the case "no explicit definitions were given because all have default definitions which are OK" differently than "some explicit definitions were given". I don't really like it that much

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

2001-02-09 Thread Fergus Henderson
On 09-Feb-2001, Brian Boutel [EMAIL PROTECTED] wrote: Patrik Jansson wrote: The fact that equality can be trivially defined as bottom does not imply that it should be a superclass of Num, it only explains that there is an ugly way of working around the problem. ... There is nothing

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

2001-02-09 Thread Marcin 'Qrczak' Kowalczyk
Sat, 10 Feb 2001 14:09:59 +1300, Brian Boutel [EMAIL PROTECTED] pisze: Can you demonstrate a revised hierarchy without Eq? What would happen to Ord, and the numeric classes that require Eq because they need signum? signum doesn't require Eq. You can use signum without having Eq, and you can