Sorry that I couldn&#39;t respond to the previous thread.. I&#39;m using Gmail and not an email client so I couldn&#39;t use the reply button. I&#39;ll try to resolve this issue soon !<div><br><div>Thanks Phillip for responding so quickly,</div>
<div><br></div><div>I tried Data.Map first and ran into the issue you mentioned..</div><div><br></div><div>I&#39;ve found a way to get around it, but it&#39;s ugly and verbose..</div><div><br></div><div>Instead, I&#39;m wondering if there is a way to use the constructors for the &quot;Val&quot; types below, in place of the keys such as:</div>
<div><br></div><div>data Val = Root Root | Oct Oct | Mode Mode deriving (Show, Eq, Ord)</div><div><br></div><div>And matching against the constructors, instead of resorting to this:</div><div><br></div><div><br></div><div>
<div>import IO</div><div>import qualified Data.Map as Map</div><div><br></div><div>type Root = String</div><div>type Oct  = Integer</div><div>type Mode = Integer</div><div><br></div><div>data Key = Root | Oct | Mode deriving (Show, Eq, Ord)</div>
<div>data Val = Root_v Root | Oct_v Oct | Mode_v Mode deriving (Show, Eq, Ord)</div><div><br></div><div>test = Map.insert Oct (Oct_v 3) . Map.insert Mode (Mode_v 0) . Map.insert Root (Root_v &quot;2&quot;) $ Map.empty</div>
<div><br></div><div>main = print test</div><div><br></div><div>--  ----&gt;  fromList [(Root,Root_v &quot;2&quot;),(Oct,Oct_v 3),(Mode,Mode_v 0)]</div><div><br></div><div><br></div><div>Many Thanks,</div><div><br></div><div>
Tom</div></div></div>