<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 &lt;<a href="mailto:jacek.generowicz@cern.ch">jacek.generowicz@cern.ch</a>&gt;<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&#39;s type system?<br>
<br>
I haven&#39;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&#39;s not plain Haskell, but I&#39;m surprised nobody mentioned the ExistentialQuantification extension, which unless I&#39;m missing something provides exactly what you want.</div>
<div><br></div><div>John</div></div>