
20 Dec
2022
20 Dec
'22
11:35 a.m.
import Control.Lens (makeLenses) data A = A { _a = (Maybe Int) } makeLenses A myA = A Nothing ma = Just 1 newA = case ma of Nothing -> myA (Just _) -> (a .~ ma) myA