compose :: (Num t) => t -> t
compose = uncurry (uncurry ((uncurry .) . (const . mad))) . dup . dup
Basically, the `const' adds a fourth (ignored) parameter to `mad' and then we uncurry that function to get it to take a tuple of tuples and then `dup . dup' the input to make `((x, x), (x, x))'. Granted, this looks nasty, but is also something that lamdabot might have been able to generate when asking for how to rewrite the obvious implementation in a point-free way.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds