<div dir="ltr"><div> Dear Haskellers,</div><div><br></div><div> let's suppose I have the following lenses</div><div><br></div><div> data Foo = Foo { _a :: String</div><div> _b :: [Double]</div><div> _c :: Vector Double</div>
<div> _d :: Int</div><div> .............. (more fields)</div><div> _z :: Double </div><div> }</div><div><br></div><div>Now, I want to update fields a,b,c and d without changing the rest.</div>
<div>What is the functional way of doing it ?</div><div><br></div><div>Surely there a function smarter than </div><div><br></div><div> set a "String" . set b [1,2,3] . set c <1,2,3> . set d 4 $ foo</div><div>
</div><div> can some please help me with it?</div><div> </div><div> Thanks in advance,</div><div> </div><div> Felipe Z.</div></div>