Reputation: 4896
How to check if map has a key using lens syntax?
import qualified Map as Map
let x = Map.member "bla" m
How to write this using lenses?
Upvotes: 4
Views: 660
Reputation: 74344
>>> Map.fromList [("bla", ())] ^. contains "bla"
True
>>> Map.fromList [("bla", ())] & contains "bla" .~ False
Map.fromList []
Upvotes: 1