User: Password:
|
|
Subscribe / Log in / New account

No thanks.

No thanks.

Posted Nov 9, 2012 17:50 UTC (Fri) by mathstuf (subscriber, #69389)
In reply to: No thanks. by HelloWorld
Parent article: Haley: We're doing an ARM64 OpenJDK port!

Intimidating, but:

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.


(Log in to post comments)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds