[m-dev.] Existentially quantified data constructors

Bert Van Nuffelen bvn at missioncriticalit.com
Thu Apr 17 17:06:30 AEST 2008


Ralph Becket wrote:
> Mark Brown, Tuesday, 15 April 2008:
>   
>> The fact that you are required to use `=>' rather than `<=' is meant to
>> be a hint that you are specifying one kind of constraint over another.
>> Perhaps it isn't strong enough, but the error message *does* try to draw
>> your attention to this.  It's also covered in section 11.2 of the reference
>> manual.
>>     
>
> I'm not saying the Reference Manual is unclear, just that it tells you
> what, not why.  Perhaps the problem is just with me, but I reckon I'm not
> alone: the picture I have when I'm programming is that a type class
> specifies an interface implemented by a vector of types.  Where things
> start to get fuzzy is with the restrictions.  I remember a certain list
> of "do"s and "don't"s (don't use equivalence types in instance
> declarations, don't repeat variables in instance declarations, instance
> variable arguments must be of the form typector(typevar, typevar, ...),
> don't mix existentially and universally quantified variables in the same
> constraint, etc.), but I'm damned if I can remember why any of those
> restrictions are necessary.  It would be Very Helpful if for each
> restriction we could provide a simple example somewhere of *why*
> violating it leads to ambiguity/unsoundness/madness/divorce.  Whether
> this document would belong in the RM or not is neither here nor there.
>
>   
Here at Mission Critical there is also a lot of interest in  such a 
document.
We stumble once in a while in the same issues mentioned above, but 
likewise Ralph the error messages do
not help to remember exactly why this or that code is not accepted.
Being able to look into a "why" list would reduce the annoyance.

Bert


--------------------------------------------------------------------------
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