Implement algebraic data type and very basic pattern matching