You can use the _Value
prism to convert to Maybe Value
, then proceed from there. The flipped fmap
operator <&>
from the lens library provides nice syntax for cases like this:
"{\"a\": 4, \"b\": 7}"^? _Value <&> members . _Number *~ 10
-- Just (Object fromList [("a",Number 40.0),("b",Number 70.0)])