[mercury-users] existential type question

Simon Taylor stayl at cs.mu.OZ.AU
Sat Nov 30 22:37:10 AEDT 2002


On 30-Nov-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> % mmc -e arg2.m
> arg2.m:022: In clause for predicate `arg2:p/2':
> arg2.m:022:   in unification of variable `MaybeArg'
> arg2.m:022:   and term `arg(Arg)':
> arg2.m:022:   type error in argument(s) of functor `arg/1'.
> arg2.m:022:   Argument 1 (Arg) has type `(some [T] T)',
> arg2.m:022:   expected type was `(some [U] U)'.
> For more information, try recompiling with `-E'.
 
> :- type maybe_arg
> 	--->	some [U] arg(U)
> 	;	no.
> 
> :- pred p(t::in, maybe_arg::out) is cc_multi.
> 
> p(I, MaybeArg) :-
> 	q(I, Univ),
> 	Arg = univ_value(Univ),
> 	MaybeArg = arg(Arg).
 
Shouldn't that be
 	MaybeArg = 'new arg'(Arg).

Simon.

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