[Haskell-cafe] Chaining a map over lists with lenses

Daniel Trstenjak daniel.trstenjak at gmail.com
Fri Oct 10 14:36:49 UTC 2014


Hi Nicola,

there's 'traversed' to access every entry of a traversable structure,
e.g. appending a "X" at the end of each 'otherField':

   t & myField . traversed . otherField %~ (++ "X")


And there's '^..' to return a list of each entry of a traversable structure:

   t ^.. myField . traversed . otherField


Greetings,
Daniel


More information about the Haskell-Cafe mailing list