| Concerning Hugs 1.3c
|
| Does hugs 1.3c not support type classes in existential types as described in
| http://www.dcs.gla.ac.uk/~simonpj/quantification.html, Section 5.2 ?
|
| data MyComplex = Complex c => MC c
|
| gives a parse error.
I didn't want to hold up Hugs 1.3c until I had implemented this
feature---an idea that originates with the work of Konstantin Laufer if
I remember correctly. I may add support for this in a future release,
but I'm not going to commit to that now. In fact, none of the
extensions in Hugs 1.3c were directly motivated by the document that
you refer to here. But I did read it and discuss aspects of it with
Simon last year, so it's probably not too surprising if there are
similarities or influences. I think it's too early to standardize on
these kind of features, and I view Hugs 1.3c as an experiment to get
some practical experience with one particular set of proposals. (From
this perspective, GHC might be seen as another one.)
The experiment is already producing results. For example, my
colleagues here at Nottingham have now persuaded me that it was a
mistake to allow the implicit binding of existentially quantified
variables in Hugs (a convention that goes back to Perry and to
Laufer). Instead, existentially quatified vars will probably require
an explicit `exists' quantifier, as in:
data MyComplex = exists c. Complex c => MC c
For symmetry, perhaps the `exists' keyword should be `forsome' ...
All the best,
Mark