Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Pointfree style considered pointless?

Name: Anonymous 2007-03-16 9:40 ID:+EPhLk32

In attempting to achieve satori, I tried to convert the following function to pointfree style:
x `divisibleBy` y = x `mod` y == 0
My first attempt looked like this:
divisibleBy = (== 0) . mod
Of course this doesn't work because mod is a two arg function and (.) requires a one arg function. So I turned to an acquaintance for help. He suggested:
divisibleBy = ((== 0) . ). mod
This works, but it's fugly. In my original version it's immediately obvious what it's doing; the pointfree version is anything but obvious. Discuss.

Name: Anonymous 2007-03-16 23:07 ID:9ACGaJIP

Man, I know haskell and I still think it sucks ass. You can do stuff with functional programming without the shit in haskell. Not to mention the blatant attempt to stick to referential transparency is pathetic.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List