[Haskell-beginners] tuple update

Ovidiu Deac ovidiudeac at gmail.com
Fri Mar 9 21:02:51 CET 2012


@Bert first& second are exactly what I was looking for. Thanks.

@Thomas: I'm not sure what you mean by fmap
What I wanted is to do this:
> let f = map $ first (*2)
> f [(1,1),(2,2),(3,3),(4,4)]
[(2,1),(4,2),(6,3),(8,4)]

On Fri, Mar 9, 2012 at 9:23 PM, Thomas Davie <tom.davie at gmail.com> wrote:

> first ofc also being known as fmap.
>
> Bob
>
> if (*ra4 != 0xffc78948) { return false; }
>
>
> On 9 Mar 2012, at 19:09, Brent Yorgey wrote:
>
> On Fri, Mar 09, 2012 at 09:07:24PM +0200, Ovidiu Deac wrote:
>
> Does anybody know if there are any functions like these in the Haskell
>
> libray?
>
>
> updateSnd f (x,y) -> (x, f y)
>
>
> updateFst f (x,y) -> (f x, y)
>
>
> Yes: 'first' and 'second' from Control.Arrow.
>
> -Brent
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120309/f6c172a8/attachment.htm>


More information about the Beginners mailing list