I have a simple parser specification like this:
postDocuments :: Parser (Text, Aeson.Value)
postDocuments =
arrayOf element
where
element =
(,) <$>
objectWithKey "id" string <*>
objectWithKey "document" value
Whenever I feed it with any unexpected JSON, it doesn't fail. Instead it just results in an empty list. But I need to know when the input is incorrect.
Is this by design? Is there a way to work around this?
I have a simple parser specification like this:
Whenever I feed it with any unexpected JSON, it doesn't fail. Instead it just results in an empty list. But I need to know when the input is incorrect.
Is this by design? Is there a way to work around this?