Actually, I think the original intent regarding greater than was:
greaterThan(100, 5);
//=> true
That is, l is greater than r, and to then properly curry the arguments do need to be flipped such that maybeGT(5) results in a function that returns whether the argument is greater than 5.Exactly right. We like to be able to do something like:
var gtThreshold = gt(100);
And then: filter(gtThreshold, array);
This is nicely fluent I would say.Someone has already addressed the maybeGT case, but you were right about the double problem. I had originally made it a squaring function, but for some dumb reason decided to make it a doubler instead just before submitting. There is a lesson in there about last moment changes. ;-)
Edit: since i'm going to complain I might as well say something nice as well. I did like this article example correctness aside, and I hadn't seen that implementation of pipeline before! Much awesome. =)