[mercury-users] constructor class syntax
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Nov 3 02:00:21 AEDT 1999
On 02-Nov-1999, Michael Day <mikeday at corplink.com.au> wrote:
>
> :- class ordered_container(C(T)) <= container(C), ordered(T) where
> [
> func lowest_element(C(T)) = T,
> func highest_element(C(T)) = T,
> ...
> and so forth
> ].
>
>
> Does that syntax look at all realistic, or possible?
I'm not sure what that syntax is supposed to mean.
How would it differ from say
:- typeclass ordered_container(C) <= container(C) where
[
func lowest_element(C(T)) = T <= ordered(T),
func highest_element(C(T)) = T <= ordered(T),
...
and so forth
].
?
Anyway, here's some references to related work:
[1] John Hughes, Restricted Datatypes in Haskell. Appeared in the 1999 Haskell Workshop.
<http://www.cs.chalmers.se/~rjmh/Papers/restricted-datatypes.ps>.
[2] Mark Jones, Type Classes and Functional Dependencies.
<http://www.cse.ogi.edu/~mpj/fds.html>.
The bibliography for [1] probably has good references to prior related work.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list