validity-aeson-0.2.0.4: Validity instances for aeson

Safe HaskellNone
LanguageHaskell2010

Data.Validity.Aeson

Contents

Synopsis

Documentation

parseJSONValid :: Validity a => Parser a -> Parser a Source #

Modify a parser to fail on invalid results.

parseJSONValidWith :: Validity a => (value -> Parser a) -> value -> Parser a Source #

Modify a parsing function to fail on invalid results.

Easy to use with the withX helper functions:

parseJSON = parseJSONValidwith . withObject "MyThing" $ \o ->
  MyThing <$> ...

Orphan instances

Validity Value Source #

A Value is valid if the recursive components are valid.

Instance details

Methods

validate :: Value -> Validation #