
3 Sep
2007
3 Sep
'07
1:53 p.m.
On Mon, 2007-09-03 at 19:47 +0200, Lars Oppermann wrote:
Dear all,
In the Haskell Wiki at http://www.haskell.org/haskellwiki/Closure there is an example for a function returning a closure given as f x = (\y -> x + y)
Another way to achieve the same effect would be to write f' x = (+) x
which to me as a beginner looks somewhat like pointfree style.
Would f' be considered to return a closure
Going backwards: Yes. The pointfree "solution" in this case would simply be f' = (+) Note that f x = \y -> x + y is written that way for emphasis and is identical to f x y = x + y