[Haskell] PROPOSAL: class aliases
Udo Stenzel
u.stenzel at web.de
Sat Oct 15 06:32:57 EDT 2005
Wolfgang Jeltsch wrote:
> This does mean that you want to treat classes without methods special, doesn't
> it?
Not quite, I'm actually not sure if I want this, I just noted that it
was possible. :) As David Menendez pointed out, empty classes probably
aren't that useless.
Anyway, not treating empty classes specially and just making the
universal instance explicit may be enough. Foo is declared an alias for
Bar by writing:
class Foo a => Bar a
instance Foo a => Bar a
The latter is not Haskell98, but a harmless extension. Doing it this
way "feels better" than introducing new syntax and semantics, at least
to me.
Udo.
--
"Don't you know that alcohol for a young man is nothing but slow poison?"
"Slow poison, eh? Well, I'm not in any hurry."
-- gefunden auf http://c2.com/cgi-bin/wiki?SlowPoison
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell/attachments/20051015/1b4fec71/attachment.bin
More information about the Haskell
mailing list