Algebraic Data Types

The Expression Problem

  • We use the visitor pattern in traditional OO to get around the problem of wanting to add a method to an interface and all its implementations.

    • What if we don't own the interface?

    • What if we don't have track of all the implementations!?