From: Jacek Generowicz <jacek.generowicz@cern.ch>
So my question is, what would be the Haskell approach to combining
heterogeneity (as provided by variant (algebraic) types) with
type-extensibility (as provided by type classes), without losing the
benefits of Haskell's type system?
I haven't looked into Template Haskell, but i guess that it is likely
to provide a solution.
But is there a solution in plain Haskell?
It's not plain Haskell, but I'm surprised nobody mentioned the ExistentialQuantification extension, which unless I'm missing something provides exactly what you want.
John