How to zoom in acid-state?

Viewed 286
data Foo = Foo {
  _bar :: Map String Integer
} deriving (Eq, Ord, Read, Show, Data, Typeable)

$(deriveSafeCopy 0 'base 'Foo)

$(makeLenses ''Foo)

Given the above code I am under the impression that it should be possible to do this:

addEntry :: String -> Update Foo ()
addEntry s = zoom bar $ modify $ insert s 0

But GHC will complain along the lines of:

src/Backend.hs:39:20:
    No instance for (Functor
                       (Control.Lens.Internal.Zoom.Zoomed (Update Foo) ()))

Any ideas?

1 Answers
Related