Fortunately, all is not lost (if you allow yourself Haskell98 + Rank-2 polymorphism + existential types). One can still represent the Equality GADT as a type class (with single method refl :: f a a), and then use Neil Ghani and Patty Johann’s decomposition of GADTs into normal algebraic datatypes plus the equality GADT. Oleg did this in OCaml in a post to the OCaml mailing list. A disadvantage of this approach is that you have to apply the type equalities by hand.

]]>tagless, partially evaluated: Tagless staged interpreters for simpler

typed languages.” Journal of Functional Programming 19(5):509-543. ]]>