[Haskell-cafe] supplying some of the arguments to a function

Scott Turner p.turner at computer.org
Fri May 6 12:20:30 EDT 2005


On 2005 May 06 Friday 11:32, Mark Goldman wrote:
> if I had a function f that took x y and z in that order, is there some
> way that I can supply y and z and get back a function that takes x?
> This question comes about after talking with a prof about currying and
> wether it buys you anything.

There's a standard function 'flip' which solves a somewhat simpler and more 
common form of this problem. If you have a function f that takes x and y, is 
there some way to supply y and get back a function that takes x?
     flip f y
Flip is defined as
    flip f x y = f y x
This technique can be extended to answer your question.  It doesn't nail down 
the value of currying.


More information about the Haskell-Cafe mailing list