[mercury-users] Question
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Aug 23 18:45:58 AEST 1999
On 22-Aug-1999, Juergen Stuber <juergen at mpi-sb.mpg.de> wrote:
> Maria Garcia de la Banda <mbanda at floyd.cs.monash.edu.au> writes:
> > :- 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.
> >
> > try(X,Y,Z):-
> > Z = apply(X,Y).
>
> What is apply? I couldn't find it in the manual.
Apply is function application. It's described in "Calling higher-order terms"
section of the "Higher-order" chapter of the Mercury language reference
manual.
> > But the compiler complains about the type of X not being func(A) = B.
> > Am I doing anything wrong?
>
> I think automatic currying doesn't apply here, so you have to
> do it explicitly.
That's correct.
--
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