[mercury-users] foreign_type

Peter Ross pro at missioncriticalit.com
Mon Jun 3 18:54:35 AEST 2002


michael wrote:
> > Also, foreign types have to be of arity 0. Is this really necessary?
It
> > would be nice to be able to define foo(T) and implement it as a
foreign
> > type where the T is unused and exists only to enforce certain
constraints
> > elsewhere in the code (separating point(global) vs. point(local) for
> > example).
>
> And you can't do this either:
>
> :- type foo(T) == foo.
> :- type foo.
>
> :- pragma foreign_type(c, foo ...)
>
Instead you could write

:- type constrained_foo(T) ---> constrained_foo(foo).

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