3 ms·
Incidentally, I couldn't resist some eta expansion. If I didn't screw it up: (((.) . (,)) .) f x g y (((.) . (,)) . f) x g y (((.) . (,)) (f x)) g
by JadeNB 10y ago
Incidentally, I couldn't resist some eta expansion. If I didn't screw it up:
(((.) . (,)) .) f x g y
(((.) . (,)) . f) x g y
(((.) . (,)) (f x)) g y
((.) ((,) (f x))) g y
((.) (f x,)) g y
((f x,) . g) y
(f x, g y)
- evincarofautumn 10y agoI wish the pointfree utility would use slightly higher-level combinators like those from Control.Arrow. Readable point-free code tends to break things up into many small reusable pieces, following the maxim of “name code, not data”. This example is totally absurd, since you’d just write “(f x, g y)” and call it a day, but you can extract a fully point-free version that’s somewhat readable. f = pairwise $ curry $ apply *** apply where pairwise = fcurry fcurry fcurry = fmap curry apply = uncurry ($)