This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Tupling & currying

2 replies
Seth Tisue
Joined: 2008-12-16,
User offline. Last seen 34 weeks 3 days ago.

In 2.7, the Function object had tupled and curried methods. There was
also a curry method on the Function class which did the same thing as
Function.curried. (I asked here in August if there was some reason for
the duplication and no one replied; I strongly suspect it was just an
oversight.)

In 2.8, the methods on the Function object are not needed anymore; Paul
Phillips has already deprecated them. We can just supply the class
methods instead.

I think "tupled" and "curried" are better names than "tuple" and
"curry". They read better. ("tuple" tends to read as the noun, when in
this case it's a verb.)

So I suggest that "curry" be deprecated and renamed to "curried", and
the "tuple" class method Paul just added a few days ago be renamed to
"tupled" (no deprecation needed since it's brand new).

I discussed this with Paul; he agrees with this change and is ready to
make it unless there is disagreement.

Donna Malayeri
Joined: 2009-10-21,
User offline. Last seen 42 years 45 weeks ago.
Re: Tupling & currying
I agree; "tuple" is a bit unusual as a verb.

Donna

On Sun, Dec 6, 2009 at 8:43 PM, Seth Tisue <seth@tisue.net> wrote:

In 2.7, the Function object had tupled and curried methods.  There was
also a curry method on the Function class which did the same thing as
Function.curried.  (I asked here in August if there was some reason for
the duplication and no one replied; I strongly suspect it was just an
oversight.)

In 2.8, the methods on the Function object are not needed anymore; Paul
Phillips has already deprecated them.  We can just supply the class
methods instead.

I think "tupled" and "curried" are better names than "tuple" and
"curry".  They read better.  ("tuple" tends to read as the noun, when in
this case it's a verb.)

So I suggest that "curry" be deprecated and renamed to "curried", and
the "tuple" class method Paul just added a few days ago be renamed to
"tupled" (no deprecation needed since it's brand new).

I discussed this with Paul; he agrees with this change and is ready to
make it unless there is disagreement.

--
Seth Tisue @ Northwestern University | http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/

extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: Tupling & currying

For the record, I should point out that it's not just that I'm willing
to make the change, but I would have preferred tupled and curried from
the outset. I named tuple tuple because curry was already there, and I
didn't prefer the adjectival forms sufficiently to advocate for
deprecating the oldish functionN method "curry" in favor of "curried".
But as long as Seth is being persistent about it (which I applaud) I may
as well throw my hat CLEARLY in the ring alongside the -ed names.

Look over there, by tupled and curried! No, inside the ring! Is that...
paulp's hat? It IS!

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland