Haskell confusion (81)

62 Name: #!/usr/bin/anonymous : 2006-04-05 15:49 ID:jLQEuxPf

>>60
I'm still not clear on why you think currying is a kludge. And, again, I would appreciate a real-world example of where these other methods are beneficial.

You might like Scheme's cut, which is somewhat similar to >>58. It's defined in SRFI 26, http://srfi.schemers.org/srfi-26/srfi-26.html.

(cut f <> <> 4 <>) = (lambda (a b c) (f a b 4 c))

I prefer currying, since it handles the common case nicely. I should also add, Haskell has "sections", where you partially-evaluate binary operators: (/2) is a function that divides its argument by two. You can also use this with any function, like

(`f`2)

to give f a second argument of 2.

This thread has been closed. You cannot post in this thread any longer.