Generic Classes?

Marcin 'Qrczak' Kowalczyk
30 Dec 2000 18:12:48 GMT

Sat, 30 Dec 2000 09:02:55 -0800, Simon Peyton-Jones <> pisze:

> They'll be in our first release of GHCi.

What about my old comments about distinguishing "the rest of
constructors" from "contents of the constructor we found", and
"the rest of fields" from "contents of the field we are considering"?

IMHO the current state is wrong. Generic instances should not
*require* that operations are directly propagated to arguements of
constructors and values of fields. What happens when we are on the
level of finding a constructor should be separated from what happens
when we are looking inside its fields. And dually, combining fields
should be separated from looking at the value of a field.

It's simple to fix, modulo performance issues. I consider the fixed
version a very good and usable solution, and the current version an
unusable partially flawed design...

It should be possible to rewrite classes which are derivable now
to use the generic mechanism instead of ad-hockery in the compiler.
Bit it will be possible only after the design is fixed not to confuse
constructors and their arguments, and not to confuse sets of fields
and their contents.

 __("<  Marcin Kowalczyk *
  ^^                      SYGNATURA ZASTĘPCZA