In pointful notation:
absoluteError x y = abs (x-y)
An unclear example in pointfree notation:
absoluteError' = curry (abs . uncurry (-))
In pointful notation:
absoluteError x y = abs (x-y)
An unclear example in pointfree notation:
absoluteError' = curry (abs . uncurry (-))
Here's how you could derive it yourself, in small steps:
so, by eta-reduction, if
f x y = g x y
we concludef = g
.Further, using
_B = (.)
for a moment,Here's a handful of ways.
absoluteError = (abs .) . (-)
absoluteError = ((.) . (.)) abs (-)
name the boobs operator something more politically correct (and what the heck, generalize it at the same time)
using semantic editor combinators:
Of course, these are all the same trick, just with different names. Enjoy!