
20 Dec
2022
20 Dec
'22
11:13 a.m.
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