[m-dev.] syntax proposals

David Jeffery dgj at miscrit.be
Wed Nov 7 20:38:22 AEDT 2001


> Another alternative might be something like:
> 
> :- begin_typeclass c(T).
> :- func f(T) = int.
> :- pred p(T).
> :- mode p(in) is semidet.
> :- end_typeclass c(T).

Interestingly, this is almost exactly the syntax Ioriginally 
proposed for type classes in Mercury many, many 
years ago. (Gee I feel old now).

At the time, the reason people rejected this syntax was
that is was fealt that a single entity such as a type class 
declaration should be a single syntactic entity (and 
hence the current one was born). I'm not sure that this
was actually very solid reasoning --- after all, we have
no problem with representing a module by a series
of terms rather than one massive term.


dgj

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list