From hadley at rice.edu  Wed May  4 16:29:21 2011
From: hadley at rice.edu (Hadley Wickham)
Date: Wed, 4 May 2011 09:29:21 -0500
Subject: [Rd] Curry: proposed new functional programming, er, function.
In-Reply-To: <7098abec0711011200va3851o811f60bb100616ce@mail.gmail.com>
References: <7098abec0711011200va3851o811f60bb100616ce@mail.gmail.com>
Message-ID: <BANLkTi=jud5hhis5y-veQKZHzSYYoPqnBw@mail.gmail.com>

I thought I might bring this up again - it now seems like Curry would
be a natural fit with Reduce, Filter, Find, Map, Negate and Position.
Any chance we might see this in a future version of R?

Hadley

On Thu, Nov 1, 2007 at 2:00 PM, Byron Ellis <byron.ellis at gmail.com> wrote:
> Hi all (especially R-core) I suppose,
>
> With the introduction of the new functional programming functions into
> base I thought I'd ask for a Curry() function. I use a simple one that
> looks this:
>
> Curry = function(FUN,...) { .orig = list(...);function(...)
> do.call(FUN,c(.orig,list(...))) }
>
> This comes in really handy when using say, heatmap():
>
> heatmap(mydata,hclustfun=Curry(hclust,method="average"))
>
> or other functions where there are ... arguments, but it's not clear
> where they should end up.
>
> --
> Byron Ellis (byron.ellis at gmail.com)
> "Oook" -- The Librarian
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



[Rd] Curry: proposed new functional programming, er, function.
Hadley Wickham