This is just a small show case how to use the magic powers of Haskell's applicatives to implement a readable validation.
We implement field-wise validation and then chain it together using both fmap and ap.
By using the validation package we can even output validation errors!
- Great blog post at Codurance about this topic in two parts:
- Vavr's Validation API
- FP-TS Validation
- Arrow-Kt Validated