There's not really a "smarter" way to do it, but there is a "prettier" way:foo& a .~ "String"& b .~ [1,2,3]& c .~ 'c'& d .~ 4-- Dan BurtonOn Mon, Nov 4, 2013 at 2:51 PM, felipe zapata <tifonzafel@gmail.com> wrote:
_______________________________________________Dear Haskellers,let's suppose I have the following lensesdata Foo = Foo { _a :: String_b :: [Double]_c :: Vector Double_d :: Int.............. (more fields)_z :: Double}Now, I want to update fields a,b,c and d without changing the rest.What is the functional way of doing it ?Surely there a function smarter thanset a "String" . set b [1,2,3] . set c <1,2,3> . set d 4 $ foocan some please help me with it?Thanks in advance,Felipe Z.
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe