0
$\begingroup$

What is the point-free version of

f(x, y)

? Is it just f or some kind of function composition, since when curried there is an implicit function which is made out of applying f to x?

$\endgroup$
7
  • $\begingroup$ As far as I know, function definitions do not identify the arguments on which they operate. Instead the definitions merely compose other functions, among which are combinators that manipulate the arguments. For example, if your code was written in python, it would be something like f(*args) $\endgroup$ – aminrd Sep 26 '19 at 21:45
  • $\begingroup$ @aminrd Thanks for your reply. Would you please elaborate a bit further. The reason for this question is the this question which states that point free version of p x y z = f (g x y) z is p = ((.) f) . g $\endgroup$ – al pal Sep 26 '19 at 22:02
  • 2
    $\begingroup$ There are tools that will mechanically do these conversions for Haskell code. Assuming you mean this to be a function of x and y (and not of f...), then you can stick \x y -> f(x,y) into pointfree.io and get an answer. $\endgroup$ – Derek Elkins left SE Sep 26 '19 at 22:25
  • 1
    $\begingroup$ @alpal (,) is constructor of pair. It's of type (,) :: a -> b -> (a, b) $\endgroup$ – Apiwat Chantawibul Sep 26 '19 at 23:54
  • 1
    $\begingroup$ No... I have a guess where you might get confused. Remember that if you write f (x,y), you are applying single argument which is pair (x,y) to f. On the other hand, f x y means you are applying 2 arguments to f. $\endgroup$ – Apiwat Chantawibul Sep 27 '19 at 4:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.