[Haskell-cafe] Lenses and Nested Maps
mgsloan at gmail.com
Tue Jun 18 03:55:11 UTC 2019
Yes, the "ix" function traverses into particular keys of map-like
So, (s & ix "bob" . ix 6 .~ 'c') will yield a modified Map with 'b'
changed to 'c'.
On Mon, Jun 17, 2019 at 9:45 PM Henry Laxen <nadine.and.henry at pobox.com> wrote:
> Hi Cafe,
> Suppose I have:
> s :: Map String (Map Int Char)
> s = M.fromList [("alice", M.fromList [(5,'a')]), ("bob", M.fromList [(6,'b')])]
> Is there any way to modify the 'b' entry easily using lenses?
> Thanks in advance.
> Best wishes,
> Henry Laxen
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
More information about the Haskell-Cafe