So, I used the aeson library and thought it would be very useful to have the following function:
v .:! f = liftM (fromMaybe mempty) (v .:? f)
When I ask GHCi for a type, I get:
(.:!) :: (Monoid r, FromJSON r) => Object -> T.Text -> aeson-0.7.0.6:Data.Aeson.Types.Internal.Parser r
However, Parser itself is not actually exported, either Data.Aeson or Data.Aeson.Types . Am I forced to not have a type signature for the function that I defined?
Alternatively, if someone knows the best way to accomplish what I'm trying to do, I will be interested in your suggestions.
source share