Hi,<br><br>A while back I asked about OO programming in Haskell and discovered existential types.&nbsp; I understood that existential types allowed me to write heterogeneous lists which seemed sufficient at the time.<br><br>Now trying to combine those ideas with records:
<br><br>data AnyNode = forall a. Node a =&gt; AnyNode a<br><br>class Node -- yadda yadda<br><br>data Branch = Branch { name :: String, description :: String, children :: [AnyNode] }<br>data Leaf = Leaf { name :: String, value :: String }
<br><br>The problem here is I can&#39;t use the same &#39;name&#39; field for both Branch and Leaf.&nbsp; Ideally I&#39;d like the name field in the Node class, but it doesn&#39;t seem that Haskell classes are for that sort of thing.
<br><br>-John<br><br>