Conversation
Notices
-
Is there a specific name in !haskell for leaving out args in the function definition (like `d = map ((*) 2)` vs `d xs = map ((*) 2) xs`)?
Thursday, 17-Nov-11 08:31:12 UTC from web-
yes: it's called "pointless" or "pointfree" notation.
-
Great, thanks! I always thought pointfree was about the (.), how stupid :)
-
@adrianlang http://www.haskell.org/haskellwiki/Pointfree#But_pointfree_has_more_points.21 explains. points=values in topology lingo.
-
This is also called Eta reduction or Eta conversion http://ur1.ca/8c294
-
I call it "partial aplication" or "currying". Am I wrong?
-
@frt Yes, can call this partial application as well. Consider this function: (\x -> 1 + x) :: Num a => a -> a
-
@frt Through eta reduc, we can get rid of the x on both sides, leaving (1 +) :: Num a => a -> a, same function, partially applying 1 to (+)
-
@dno Thanks for posting this, I've butted my head against currying several times, but this explanation finally made it clear.
-
Something happened to my post, not always showing for me in this convo. That link about currying again: http://ur1.ca/8p3m2
-