
11 Dec
2010
11 Dec
'10
9:27 a.m.
On Fri, Dec 10, 2010 at 1:05 PM, Tobias Brandt
To use an operator as a function you must use the section notation:
pl a = (a ++)
Note that the section notation is slightly more flexible than the above since you can also do :
pl b = (++ b)
So that's not currying per se since operators are not syntactically handled like functions. Of course behind the scene operators are only functions, to use them strictly as normal functions Haskell provide the following syntax :
pl a b = (++) a b
So your first try could be written :
pl a = (++) a
Just like with an ordinary function. The second section notation variant (++ b) is perfectly equivalent to the following :
pl b = flip (++) b
-- Jedaï