
Hello! I have a record like this: data A = { _bs :: [B]} funcA :: State A () funcA = bs ??? funcB funcB :: State B () funcB = ... What lens operator should I use instead of ???, to update all my Bs? Cheers, Corentin

Hi Corentin, On Sun, May 04, 2014 at 10:34:34PM +0200, Corentin Dupont wrote:
I have a record like this:
data A = { _bs :: [B]}
funcA :: State A () funcA = bs ??? funcB
funcB :: State B () funcB = ...
You might have something like: funcA :: State A () funcA = bs . traversed %= funcB funcB :: B -> B funcB = ... Greetings, Daniel

On Sun, 4 May 2014 22:34:34 +0200, Corentin Dupont
Hello! I have a record like this:
data A = { _bs :: [B]}
funcA :: State A () funcA = bs ??? funcB
funcB :: State B () funcB = ...
What lens operator should I use instead of ???, to update all my Bs?
Cheers, Corentin
zoom (bs.traverse) :: State B () -> State A ()
participants (3)
-
Corentin Dupont
-
Daniel Trstenjak
-
Niklas Haas