gadt
GADT stands for Generalized Algebraic Data Type, a form of algebraic data type used in statically typed functional programming languages. Unlike conventional algebraic data types (ADTs), GADTs allow the result type of each data constructor to be instantiated to more specific type instances, effectively giving constructors their own return types. This yields type indices and more precise typing information that the compiler can use during pattern matching and type checking.
GADTs are useful for encoding invariants in types, representing typed abstract syntax trees, implementing safe heterogeneous
Semantically, GADTs generalize ADTs and are closely related to indexed or dependent types; they can be viewed
While powerful, GADTs introduce complexity in type checking, may interact subtly with features like type classes