Name: Anonymous 2007-03-16 9:40 ID:+EPhLk32
In attempting to achieve satori, I tried to convert the following function to pointfree style:
My first attempt looked like this:
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:
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.
x `divisibleBy` y = x `mod` y == 0My first attempt looked like this:
divisibleBy = (== 0) . modOf 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) . ). modThis 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.