Please clarify your question. Your code doesn't compile, and I can't tell what it's supposed to do.

On Tue, Dec 20, 2022, 11:13 AM PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> wrote:
Hello,

I have a data whcih contain a Maybe value

data A = A (_a = Maybe a)

I would like to use a lens in order to merge two values with this log

replace the value only if it is a (Just a)

So My question is

is there something more elegant than

let myA' = case ma of
              Nothing  -> conf
              (Just na) -> (a .~ na) myA

Thanks for your help

Frederic
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.