[Haskell-cafe] lens and Maybe value

Tom Ellis tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk
Tue Dec 20 16:33:41 UTC 2022

On Tue, Dec 20, 2022 at 05:25:35PM +0100, PICCA Frederic-Emmanuel wrote:
> > Please clarify your question. Your code doesn't compile, and I can't tell
> > what it's supposed to do.
> replace a (Maybe a) value in a data using lens only if the new (Maybe a) is a Just

How about

    over a (mb <|>)


More information about the Haskell-Cafe mailing list