3 ms·
In Haskell, there isn't any null. The type-system ensures that a function can not receive a null value. Functions can opt-in to the possibility of receiving 'N
by sgk284 12y ago
In Haskell, there isn't any null. The type-system ensures that a function can not receive a null value.
Functions can opt-in to the possibility of receiving 'Nothing' as a potential value. The tooling provided to Haskell can then also tell you when your function has not exhaustively handled every possible type of input (including Nothing).
In this instance, the type system provides robust automated coverage of your function's input domain w/regard to null values. Obviously type systems can't do everything, but they are the most light-weight formal methods we have.