Currently, the design of the typed validation is assuming that the supplied types are ducks in the style of dry-types with the monads extension enabled. While this is perfectly satisfactory if you already have dry-types around, it makes it onerous to create custom types and coercions.
If dry-types is instead treated as a configurable plug for the library, the type interface can be trimmed down to a very compact object that is easier to customize.
It's also worth considering that at that level of abstraction, the typed validation is effectively just a thin shim around a normal validation, and could just as easily be considered a parameterized rule validation. Determine whether this is a divide worth preserving.
Currently, the design of the
typedvalidation is assuming that the supplied types are ducks in the style ofdry-typeswith the monads extension enabled. While this is perfectly satisfactory if you already have dry-types around, it makes it onerous to create custom types and coercions.If dry-types is instead treated as a configurable plug for the library, the type interface can be trimmed down to a very compact object that is easier to customize.
It's also worth considering that at that level of abstraction, the
typedvalidation is effectively just a thin shim around a normal validation, and could just as easily be considered a parameterizedrulevalidation. Determine whether this is a divide worth preserving.