Skip to content

Instantly share code, notes, and snippets.

// Porting of the "Arithmetic expressions" example at https://en.wikibooks.org/wiki/Haskell/GADT
// (partially) related TS discussions:
// - https://github.com/microsoft/TypeScript/issues/12424
// - https://github.com/microsoft/TypeScript/issues/17325
// Definition of `Expr` in Haskell using GADTs
// data Expr a where
// I :: Int -> Expr Int
// B :: Bool -> Expr Bool