Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utility functions for use defining autodocodec codecs.
Synopsis
- versionField :: Integer -> ObjectCodec a Scientific
- optionalVersionField :: Integer -> ObjectCodec a (Maybe Scientific)
Documentation
versionField :: Integer -> ObjectCodec a Scientific Source #
Defines a required object field named version
that must have the given
integer value. On serialization the field will have the given value
automatically. On deserialization parsing will fail unless the field has the
exact given value.
optionalVersionField :: Integer -> ObjectCodec a (Maybe Scientific) Source #
Defines an optional object field named version
that must have the given
integer value if the field is present. On serialization the field will have
the given value automatically. On deserialization parsing will fail unless
the field has the exact given value, or is absent.