[mercury-users] Question

Maria Garcia de la Banda mbanda at floyd.cs.monash.edu.au
Fri Aug 20 17:08:38 AEST 1999


I am trying to define a predicate which among other things receives a
function as first argument, applies something to it, and returns the
resulting function. For example:

:- mode out(T) :: new -> T.

:- pred try(func(int,int)=int,int,func(int) = int).
:- mode try(func(in,in) = out is det,in,out(func(in) = out is det)) is det.

        Z = apply(X,Y).

But the compiler complains about the type of X not being func(A) = B. Am I
doing anything wrong? is there a better way to do it? is this simply not
supported in Mercury? Thanks for the help!



| mbanda at cs.monash.edu.au   | Maria Garcia de la Banda                 | 
| (+61 3) 9905 5777 (Phone) | School of Computer Science and S.E.      |
| (+61 3) 9905 5146( Fax)   | Office 143, building 19, Clayton Campus  |  
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