Skip to content

Details

Representing state is hard to do well. Play too loosely with it and you can land yourself in a world of hurt. Data structures like the Optional type help us to safely and concisely model state in a strongly typed way. This allows us to easily reason about and handle the various states in a safe manner.

The Result is another type that helps us to model state in a type safe way. It’s a peculiar type that made its way into the Swift Standard Library by strong community demand (surprisingly against some of the wishes of members on the core team). Its a bit of a controversial type and it begs the question… don’t you want to see what all the fuss is about?

Members are also interested in