
16 Jan
2009
16 Jan
'09
10:32 a.m.
<saml> @pl myFunc f (a,b) (c,d) = (f a c, f b d)
<lambdabot> myFunc = (`ap` snd) . (. fst) . flip flip snd . ((flip . (ap .))
.) . flip flip fst . ((flip . ((.) .)) .) . (flip =<< (((.) . flip . (((.) .
(,)) .)) .))
why not use zipWith?
[a,b] `g` [c,d] where g = zipWith f
2009/1/16 Andrew Wagner
I've been playing around with this, but haven't been able to come up with anything. myFunc f (a,b) (c,d) = (f a c, f b d)
It feels as if there should be a nice simple version of this using some combination of {un,}curry, "on", &&&, ***, or something else.
Any thoughts?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe