scrambled
Concept

Expression problem

Modified just now
Books JourneyProgramming Language Theory Statuslearning

Neither paradigm naturally supports both dimensions of extensibility without modifying existing code or sacrificing Type safety. Solutions exist (type classes, object algebras, tagless final) but invo

ApproachEasy to addHard to add
${fref("programming-language-theory/concepts/algebraic-data-type.td")}s + functionsNew functions (just define another)New variants (must edit all existing functions)
OO classes + methodsNew variants (just add subclass)New operations (must edit all existing classes)

Neither paradigm naturally supports both dimensions of extensibility without modifying existing code or sacrificing type safety. Solutions exist (type classes, object algebras, tagless final) but involve trade-offs.