How about something like
[('a',Just 1),('b',Nothing)]^..folded.aside _Just
Using (^..)
and folded
from Control.Lens.Fold
and aside
and _Just
from Control.Lens.Prism
.
The key is aside
, a handy function that builds a prism working on a pair from a prism working on a component of the pair.