2 ms·
> You can also simulate sum-types via what OOP people would probably call a visitor pattern You can also simulate it by using if/else everywhere. At this poin
by pyrale 1y ago
> You can also simulate sum-types via what OOP people would probably call a visitor pattern
You can also simulate it by using if/else everywhere.
At this point, that means you have zero language feature supporting the use case, and type safety is up to the developers implementing patterns correctly everywhere.