F# ad astra series


Taking F# to the stars is a series about the building blocks necessary to create a solution that reliably and safely achieves its purpose without ever faulting, and trust me, this is something your starship needs.

When venturing in the functional world, you will hopefully very quickly learn how to create pure code that never generates exceptions. I know, this sounds like fantasy coming from traditional object oriented development, but it’s very real.

While pure code is as close to perfection as humans will ever get, there are things you can’t possibly control, like human input for instance.

Saving our code from ourselves

We need something to ensure that our domain is always valid, regardless of what users type in text boxes or whatever other impure content is sent its way, and the solution to this problem — in fact the only effective solution — is to create a domain with self-validating custom types instead of generic types such as strings.

So if we already know the solution, what’s the big deal? The problem is that this solution requires a lot more code, and nobody likes to write a lot more code to achieve similar results. This is where validation blocks come in.

For your convenience all 4 articles in this introductory series to validation blocks can be found below, in chronological order. If you only read one, just read the last one. If you only read two, read the first and last one. Whatever you read, I wish you a safe flight!

These aren't the types you're looking for

splash Imagine your object needs a property for text values. You declare it as string, right? Wrong! 😱

Jack-in-the-box code

splash Most of the time your code plays a beautiful song, but turn that crank for long enough...

Put your F# domain on a diet

splash Do this one thing for instant domain weight loss!!! 🤩🤫🤭

Take F# to the stars

splash Your airtight domain will keep you safe
© 2020 Luis Ferrao — Powered by Jekyll & Poole