4 ms·
Turing hardly prevents it; indeed, by the Church-Turing thesis, shows us how it’s done: write an abstract model of your problem space. This is your types and t
by brians 9y ago
Turing hardly prevents it; indeed, by the Church-Turing thesis, shows us how it’s done: write an abstract model of your problem space. This is your types and type functions (like Option/Some/Maybe). Write a type that is the theorem claiming you get your output from your input. Now you guarantee you cannot do the wrong thing. Affordances for the right behaviors? Those are library functions you build bottom up, or assemble from a library of structures (functor, monad, etc.) and your types. As all affordances, there are art and craft here.
On semantic nulls, the compiler typically enforces completeness on case analysis.
- mannykannot 9y agoYes, I should have scrubbed that paragraph and started over, to say something like eliminating nulls is only part of the problem, and you still have to do everything right, starting with your abstract model of the problem space. With regard to semantic nulls, I offered NaN as an example, but I was thinking of the case where the programmer introduces what is, in practice, a semantic null value for one of his user-defined types - something that should be distinguished as a special case, but isn't.