I have a data similar to, but a bit more nested and of course named differently:
data AppModel = AppModel
{ _foo :: Maybe String
} deriving (Eq, Show)
I would like to pass it to the Monomer textField
textField :: WidgetEvent e => ALens' s Text -> WidgetNode s e
textField field = textField_ field def
I found it can be lensed with _Just
prism, but when appling it in the way it was suggested https://stackoverflow.com/a/44624359/11684473
textField $ foo . _Just . packed
It fails with:
No instance for (Applicative (Control.Lens.Internal.Context.Pretext (->) Text Text)) arising from a use of ‘_Just’
**What will be the proper way to expose the maybe value in the textField
?