Sum Type
A data type consisting of two or more distinct branches with different representations. For example, the following Haskell data type might be used to identify a user in an information system:
data IdOrEmail = Id UserId | Email EmailAddress
A data type consisting of two or more distinct branches with different representations. For example, the following Haskell data type might be used to identify a user in an information system:
data IdOrEmail = Id UserId | Email EmailAddress