<div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The answer is, I&#39;m working on a recently semi-released package called TrieMap.<br>

<br>The objective of this package, building off of the work in this <a href="https://docs.google.com/Doc?docid=0AWuaUF8ZNTNDZHB3emdyaF8zMzNmZmtmcHo2Yw&amp;hl=en" target="_blank">paper</a>, is to automatically derive the type of a generalized trie for any algebraic type based on its algebraic representation.  (I am working on writing up my methods for publication.)<br>



<br>Of course, if I could get automatic access to the mechanisms of a type&#39;s constructors, I wouldn&#39;t even require users to describe the algebraic representation of their type...</blockquote><div><br>Well, it&#39;s relatively easy to use Template Haskell to determine the structure of a datatype. Look in the &quot;Generics&quot; category on Hackage for a number of examples (e.g. emgm, regular, multirec) or see if the Derive package will do it for you. According to Neil Mitchell, you just need one example:<br>

<br>  <a href="http://www.cogsys.wiai.uni-bamberg.de/aaip09/aaip09_submissions/talk_mitchell.pdf">http://www.cogsys.wiai.uni-bamberg.de/aaip09/aaip09_submissions/talk_mitchell.pdf</a><br><br>I don&#39;t know if it&#39;s easy or even possible to capture a sum-of-products view from SYB.<br>

<br>Sean<br></div></div>