DigiNews

Tech Watch Articles

← Back to articles

Visitor as a sum type (2018)

Quality: 8/10 Relevance: 9/10

Summary

The article argues that the Visitor design pattern is isomorphic to sum types and walks through a practical series of refactorings—from Church-encoded sums to interfaces and visitors—in C#. It also discusses the trade-offs between algebraic data types and OO patterns, with concrete examples like PaymentType and its JSON conversion.

🚀 Service construit par Johan Denoyer