composite-aeson-refined-0.5.2.0: composite-aeson support for Refined from the refined package

Safe HaskellNone
LanguageHaskell2010

Composite.Aeson.Refined

Contents

Synopsis

Documentation

refinedJsonFormat :: Predicate p a => JsonFormat e a -> JsonFormat e (Refined p a) Source #

Given a JsonFormat e a, produce a JsonFormat e (Refined p a) where p is some Predicate from the refined library for a.

This maps to the same JSON as the given JsonFormat, but when parsing it will apply refine to assert that the incoming JSON value conforms to the predicate, failing to parse if not.

Orphan instances