[Haskell-cafe] Lenses and Nested Maps

Henry Laxen nadine.and.henry at pobox.com
Tue Jun 18 03:42:45 UTC 2019


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



More information about the Haskell-Cafe mailing list