4 ms·
> There's no way to ask for a not-null pointer at the type level, so you have to check for nullity everywhere and good luck debugging those runtime panics. You
by Mawr 3y ago
> There's no way to ask for a not-null pointer at the type level, so you have to check for nullity everywhere and good luck debugging those runtime panics.
You can write a simple Option type yourself using generics [1]. It's not strictly idiomatic and you do have to remember to use it, but it works well.
[1]: (my post) https://news.ycombinator.com/item?id=38331565 https://news.ycombinator.com/item?id=38331565