Skip to content

Zooming in MonadState #316

@nikita-volkov

Description

@nikita-volkov

I have a function in which I'm trying to use zoom like so:

replaceArtistCascadingly 
  :: Artist -> Artist -> Acid.Update ProcessedCatalogue ()
replaceArtistCascadingly old new = do
  zoom albumsL $ do
    undefined

Acid.Update is an instance of MonadState. However I get the following error:

  No instance for (Functor
                       (Control.Lens.Internal.Zoom.Zoomed
                          (Acid.Update ProcessedCatalogue) [Album]))
      arising from a use of `albumsL'

But if I change the type signature to

Artist -> Artist -> State ProcessedCatalogue ()

the function compiles just fine.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions