[mercury-users] Question

Juergen Stuber juergen at mpi-sb.mpg.de
Mon Aug 23 20:24:07 AEST 1999


Fergus Henderson <fjh at cs.mu.OZ.AU> writes:
> >
> > > 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.

After thinking a little bit more about it, I'm almost convinced
that this is a bug.  The manual says:

	You can also create higher-order function terms of
	non-zero arity and higher-order predicate terms by
	"currying", i.e. specifying the first few arguments to a
	predicate or function, but leaving the remaining arguments
	unspecified. For example, the unification

	Sum123 = sum([1,2,3])

	binds `Sum123' to a higher-order predicate term of type
	`pred(int)'. Similarly, the unification

	Double = scalar_product(2)

	binds `Double' to a higher-order function term of type
	`func(list(int)) = list(int)'.

Why should `Double = scalar_product([2])' be handled differently
from `FY = F(Y)' when `F' is a binary function?

Jürgen

-- 
Jürgen Stuber <juergen at mpi-sb.mpg.de>
http://www.mpi-sb.mpg.de/~juergen/
--------------------------------------------------------------------------
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