A bi-directional mapping between values of type L
and values of type H
.
Low-level values of type L
can be decoded to a higher-level value of type H
. The decoding can fail; this is represented by a
result of type DecodeResult.Failure. Failures might occur due to format errors, wrong arity, exceptions, or validation errors.
Validators can be added through the validate
method.
High-level values of type H
can be encoded as a low-level value of type L
.
Mappings can be chained using one of the map
functions.
- Type parameters:
- H
The type of the high-level value.
- L
The type of the low-level value.
- Companion:
- object