<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">From: Jacek Generowicz <<a href="mailto:jacek.generowicz@cern.ch">jacek.generowicz@cern.ch</a>><br>
<br>
So my question is, what would be the Haskell approach to combining<br>
heterogeneity (as provided by variant (algebraic) types) with<br>
type-extensibility (as provided by type classes), without losing the<br>
benefits of Haskell's type system?<br>
<br>
I haven't looked into Template Haskell, but i guess that it is likely<br>
to provide a solution.<br>
But is there a solution in plain Haskell?<br></blockquote><div><br></div><div>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.</div>
<div><br></div><div>John</div></div>