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 16:59 ID:jzChVXNP

>>14
Lies, I searched reddit for ``4chan'' but found nothing linking to prog.

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