Hacker News new | ask | show | jobs
by scubbo 2080 days ago
> the compiler won't let you "access" the customer until you've safely checked that the result is, indeed, the customer rather than an error.

/u/anw's example shows that, in fact, the benefits of the type system are greater than that. Not only can the type system prevent you from accessing data before confirming that the data is present (which is, at the end of the day, not much better than an Optional type, already available in Java and others), but it can also prompt you to "handle" all possible cases.