3 ms·
> How do you model a "zero or one" relationship without null? With something that leaves "Nullpointer analysis" obsolete/useless.
by Dewie3 11y ago
> How do you model a "zero or one" relationship without null?
With something that leaves "Nullpointer analysis" obsolete/useless.
- seanmcdirmid 11y agoTo be replaced with an analysis that finds unmatched cases (like None when you assumed Maybe)?
- Dewie3 11y agoWhy would a constructor be confused with a type constructor? I guess I just don't have any experience with this particular approach to "sums". Untagged variants?
- asterite 11y agoA tiny observation here: we don't do "null pointer analysis". We do this kind of analysis for every type: if you invoke a method on a type and that method doesn't exist, you get a compile error. In the case of a type union, all types must respond to that method. "Nil | T" is just one particular type union, but you can also have "Int32 | String", etc.
- Dewie3 11y agoThanks, that clears things up. I assumed that Nullpointer analysis was a special case.