[Haskell-cafe] Simplification of this function?
sam lee
skynare at gmail.com
Fri Jan 16 10:36:18 EST 2009
Sorry it won't work because list should be homogeneous.
I think your myFunc is standard.
This guy names it "thread":
http://alaska-kamtchatka.blogspot.com/2009/01/essence-of-concatenative-languages.html
On Fri, Jan 16, 2009 at 10:32 AM, sam lee <skynare at gmail.com> wrote:
> <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 <wagner.andrew at gmail.com>
>
>> 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 at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090116/ecc31ac6/attachment-0001.htm
More information about the Haskell-Cafe
mailing list