[Haskell-beginners] tuple update

Brent Yorgey byorgey at seas.upenn.edu
Fri Mar 9 20:09:53 CET 2012


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



More information about the Beginners mailing list