ABtype
ABtype is a theoretical data construct used in programming language theory to represent a value that may be one of two distinct alternatives, A or B. It is a binary sum type, also known as a discriminated union, where exactly one variant is present at runtime.
Formal definition: ABtype<A, B> consists of two constructors, A(value: A) and B(value: B).
Semantics and usage: Values of ABtype are created by one of the two constructors. Pattern matching or
Relation to other types: ABtype is analogous to a sum type found in many languages, such as
Use cases: ABtype is useful for modeling choices between two forms, such as a computation that may
Examples: Haskell-like: data ABtype a b = A a | B b. TypeScript-like: type ABtype<a,b> = { tag: 'A', value: