[mercury-users] Currying to create a higher-order value.

Paul Bone pbone at csse.unimelb.edu.au
Wed Sep 26 14:36:19 AEST 2007


On Wed, Sep 26, 2007 at 02:21:12PM +1000, Peter Wang wrote:
> On 2007-09-26, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
> > 
> > 
> > Recently I submitted a changeset to mercury-reviews for review.  Peter
> > suggested that could use currying to write less code, I've used currying
> > before to create a higher order term from a predicate name and some
> > variables such as.
> > 
> >     map(transform(Some, Args), ListIn, ListOut)
> > 
> > However I already have a higher order term which I'm trying to curry.
> > This seems to upset the complier.
> > 
> >     list.takewhile(RawThresholdPred(Deep, Threshold), DescendingPSIs, TopPSIs, 
> >         _)
> 
> Sorry Paul.  Indeed you can't use currying in this case.
>

Ok.  Thanks.


--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list