| From | Sent On | Attachments |
|---|---|---|
| John Meacham | Oct 12, 2005 7:41 pm | |
| Philippa Cowderoy | Oct 12, 2005 7:55 pm | |
| John Meacham | Oct 12, 2005 8:16 pm | |
| Wolfgang Jeltsch | Oct 13, 2005 5:48 am | |
| John Meacham | Oct 13, 2005 6:03 am | |
| Malcolm Wallace | Oct 13, 2005 6:15 am | |
| Andres Loeh | Oct 13, 2005 6:23 am | |
| Malcolm Wallace | Oct 13, 2005 6:29 am | |
| John Meacham | Oct 13, 2005 6:37 am | |
| John Meacham | Oct 13, 2005 6:39 am | |
| Simon Peyton-Jones | Oct 13, 2005 7:02 am | |
| Benjamin Franksen | Oct 13, 2005 7:26 am | |
| Benjamin Franksen | Oct 13, 2005 7:33 am | |
| S.M.Kahrs | Oct 13, 2005 7:37 am | |
| John Meacham | Oct 13, 2005 8:32 am | |
| Simon Peyton-Jones | Oct 13, 2005 9:23 am | |
| Udo Stenzel | Oct 13, 2005 9:46 am | |
| Jan-Willem Maessen | Oct 13, 2005 9:58 am | |
| Paul Govereau | Oct 13, 2005 1:21 pm | |
| Jacques Carette | Oct 13, 2005 1:52 pm | |
| John Meacham | Oct 13, 2005 4:45 pm | |
| John Meacham | Oct 13, 2005 6:13 pm | |
| John Meacham | Oct 13, 2005 6:21 pm | |
| David Menendez | Oct 13, 2005 6:49 pm | |
| John Meacham | Oct 13, 2005 8:33 pm | |
| aj...@spamcop.net | Oct 13, 2005 11:25 pm | |
| Ashley Yakeley | Oct 14, 2005 6:20 am | |
| Ashley Yakeley | Oct 14, 2005 6:31 am | |
| Wolfgang Jeltsch | Oct 14, 2005 9:46 am | |
| Wolfgang Jeltsch | Oct 14, 2005 11:44 am | |
| Wolfgang Jeltsch | Oct 14, 2005 11:47 am | |
| Remi Turk | Oct 14, 2005 2:05 pm | |
| Udo Stenzel | Oct 15, 2005 6:15 am | |
| Ross Paterson | Oct 27, 2005 6:58 am | |
| Wolfgang Jeltsch | Oct 28, 2005 7:05 am |
| Subject: | [Haskell] PROPOSAL: class aliases | |
|---|---|---|
| From: | Benjamin Franksen (benj...@bessy.de) | |
| Date: | Oct 13, 2005 7:26:34 am | |
| List: | org.haskell.haskell | |
On Thursday 13 October 2005 12:22, John Meacham wrote:
On Thu, Oct 13, 2005 at 12:08:27PM +0200, Wolfgang Jeltsch wrote:
We allow new constructs of this form (the exact syntax is flexible of
course):
class alias (Foo a, Bar a) => FooBar a where foo = ...
what this does is declare 'FooBar a' as an alias for the two constraints 'Foo a' and 'Bar a'. This affects two things.
Wouldn't it be better to write it this way:
class alias (Foo a, Bar a) = FooBar a where ...
(Foo a, Bar a) => FooBar a normally means that a type is an instance of Foo and Bar if it is an instance of FooBar but in the case of aliases, a type is also an instance of FooBar if it is an instance of Foo and Bar.
Yeah, I totally agree. it would also reduce confusion with superclasses and emphasises the fact that the two sides are equivalent everywhere. (except instance heads)
although perhaps
class alias FooBar a = (Foo a, Bar a) where ...
since the new name introduced usually appears to the left of an equals sign. This also solves the problems of where to put new supertype constraints.
Using '=' instead of '=>', you could even leave out the 'alias':
class FooBar a = (Foo a, Bar a) where ...
Ben





