I have a type like this:

```
data Problem =
   ProblemFoo Foo |
   ProblemBar Bar |
   ProblemBaz Baz

```

`Foo`, `Bar` and `Baz` all have a lens for their names:

```
fooName :: Lens' Foo String
barName :: Lens' Bar String
bazName :: Lens' Baz String

```

Now I'd like to create a lens

```
problemName :: Lens' Problem String

```

Clearly I can write this using the [`lens`](http://hackage.haskell.org/package/lens-4.17/docs/Control-Lens-Lens.html#v:lens) construction function and a pair of case statements, but is there a better way?

The documentation for [`outside`](http://hackage.haskell.org/package/lens-4.17/docs/Control-Lens-Prism.html#v:outside) talks about using a Prism as a kind of first-class pattern, which sounds suggestive, but I can't see how to actually make it happen.

(Edit: added `Baz` case because my real problem isn't isomorphic with `Either`.)