[This post originally appeared on Jonathan’s personal blog -> https://blog.jonathanchannon.com/2020-07-17-understanding-fsharp-applicatives-custom-operators]
After discussing something with Ian Russell he suggested I take some time to read through another fine blog post he has written and understand F# applicatives and custom operators. I found myself in familiar territory when reading F# blog posts and it's something similar to the five stages of grief. Nod, Nod, I understand what's going on, Umm, WTF is going on. As Ian did in his Intro to F# series he sets out a simple domain problem and goes about how to address it. We want to return a ValidatedUser
from a function but if the user fails validation we return a list of validation errors.
The code in the blog post was pretty self explanatory until, it wasn't, which I have pasted below: