Gavin Wraith wrote:

> I use Gofer 2.28 and a home-brewed prelude. Multi-parameter classes
> let me do things that I do not think can be done in Haskell, but which
> definitely make life simpler.
>
> ...

Is Haskell going to be extented with multi-parameter classes?
It is obviously not in the report 1.2 (I havent's seen 1.3 yet).

In trying to compile pH we ran into one problem that Haskell has
with arrays. In Haskell, the constructor "array" and the reference
operator (!) are not methods of some class, say "Array", because
such a class cannot be defined (both the constructor and the reference
operator needs two type parameters: one for the index, and one for
the elements). This has the unfortunate consequence that occurrences
of "array" and (!) cannot be resolved to particular instances even
when the types of the index and the elements are known.

I am not sure how current Haskell compilers inline
array constructors and references, otherwise the overhead would
simply be unacceptable.  With multi-parameter classes, it would
be easy to define an Array class of integer indexes up to a few
dimensions --- practically these are the only ones used.

(I haven't been following the Haskell mailing list closely,
so pardon me if this topic has already been discussed before ...)

Yuli Zhou
NE43-253, MIT-LCS
[EMAIL PROTECTED]

Reply via email to