[m-dev.] Existentially quantified data constructors

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Apr 15 17:47:05 AEST 2008


On Tue, 15 Apr 2008, Ralph Becket wrote:

> Mark Brown, Tuesday, 15 April 2008:
>> On 15-Apr-2008, Ralph Becket <rafe at csse.unimelb.edu.au> wrote:
>>> Julien Fischer, Tuesday, 15 April 2008:
>>>> Presumably you are looking for a more enlightening answer than: it's not
>>>> valid Mercury?
>>>
>>> I did manage to infer that from the error message...
>>
>> It surprises me how often that doesn't happen.  :-(
>
> Not with type classes.  We do find genuine compiler bugs in there from time
> to time.  Worse, it's very hard to understand *why* some apparently
> reasonable things are forbidden.  The usual answer is "go, read this
> paper", but that (a) takes a non-trivial amount of time and (b) tends to
> have the mental residency time of a few hours (unless you're one of the
> people developing the code for the type checker...).  In the vernacular
> of the tree-huggers, it's not a sustainable explanatory method.
>
> The reference manual is pretty clear about saying what you are allowed
> to do with type classes most of the time.  It does not make it clear why
> that is *all* you are allowed to do.

Explaining that is beyond the scope of the reference manual.  It is
intended to say what the language is.  It is _not_ intended to try
and rationalise various design decisions.  (It's no different in, for
example the C standard - although admittedly in that case there is
a separate Rationale document that attempts to explains some of the
thinking behind it.)

Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list