Re:GADTs for Dummies
by siraben on Wednesday May 19, 2021 @03:12AM
(#27205533)
One thing that I'd like to add is that using the typed GADT encoding of the AST lets you write a total eval function such as eval :: AST r → r, no need to return a Maybe or Either! In the case without GADTs you couldn't return a boolean in one case and an Int in another. Here you can.
[ Parent
| on HN ]