[mercury-users] Question

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Aug 24 19:42:56 AEST 1999


On 24-Aug-1999, Juergen Stuber <juergen at mpi-sb.mpg.de> wrote:
> Fergus Henderson <fjh at cs.mu.OZ.AU> writes:
> > The other question is about the rationale for that language design choice:
> > why did we choose this design?  Why should the language be defined in a way
> > that causes `Double = scalar_product([2])' to be handled differently from
> > `FY = F(Y)' when `F' is a binary function?  The answer to this one is that
> > the former is easier to type than the latter.
...
> This is because apply is overloaded to take an arbitrary number of arguments.
> If everything were curried in the first place (like in ML or Haskell) and
> F(X1,...,Xn) were just syntactic sugar for (...((F(X1))(X2))...(Xn))
> then this wouldn't be a problem, or would it?

You are correct, it wouldn't be a problem.

However, making everything implicitly curried isn't as straight-forward
as it sounds, I think, due to interactions with predicates and the mode
system.  Also it's more difficult to implement efficiently, I think.

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