Thank you for your rich responses.<br><br>Indeed I think I miss some thinks in my DSL, that would make things easier to deal with lists and first class functions.<br>I don&#39;t really know what for now.<br>Perhaps a List Constructor? Or a constructor on functions like yours Ryan?<br>

EAp :: Exp ref (a -&gt; b) -&gt; Exp ref a -&gt; Exp ref b<br>It&#39;s from which DSL? It is accessible on the net?<br><br>Chris suggested me that I can only define the Foldr constructor and deduce Map from it.<br>But maybe I have to add a List constructor for that.<br>
<br>But in the suggestions from Ryan and Brandon I don&#39;t understand why I should add an extra type parameter and what it is!<br>
<br>Steffen: Wow nice. I&#39;ll integrate that ;)<br><br>I&#39;m also looking at the Atom&#39;s DSL to get inspiration. <br>Something I don&#39;t understand in it is that it has two languages, on typed:<br><pre><span class="hs-keyword">data</span> <span class="hs-conid">E</span> <span class="hs-varid">a</span> <span class="hs-keyword">where</span><br>
<a name="line-185"></a>  <span class="hs-conid">VRef</span>    <span class="hs-keyglyph">::</span> <span class="hs-conid">V</span> <span class="hs-varid">a</span> <span class="hs-keyglyph">-&gt;</span> <span class="hs-conid">E</span> <span class="hs-varid">a</span><br>
<a name="line-186"></a>  <span class="hs-conid">Const</span>   <span class="hs-keyglyph">::</span> <span class="hs-varid">a</span> <span class="hs-keyglyph">-&gt;</span> <span class="hs-conid">E</span> <span class="hs-varid">a</span><br>
<a name="line-187"></a>  <span class="hs-conid">Cast</span>    <span class="hs-keyglyph">::</span> <span class="hs-layout">(</span><span class="hs-conid">NumE</span> <span class="hs-varid">a</span><span class="hs-layout">,</span> <span class="hs-conid">NumE</span> <span class="hs-varid">b</span><span class="hs-layout">)</span> <span class="hs-keyglyph">=&gt;</span> <span class="hs-conid">E</span> <span class="hs-varid">a</span> <span class="hs-keyglyph">-&gt;</span> <span class="hs-conid">E</span> <span class="hs-varid">b</span><br>
<a name="line-188"></a>  <span class="hs-conid">Add</span>     <span class="hs-keyglyph">::</span> <span class="hs-conid">NumE</span> <span class="hs-varid">a</span> <span class="hs-keyglyph">=&gt;</span> <span class="hs-conid">E</span> <span class="hs-varid">a</span> <span class="hs-keyglyph">-&gt;</span> <span class="hs-conid">E</span> <span class="hs-varid">a</span> <span class="hs-keyglyph">-&gt;</span> <span class="hs-conid">E</span> <span class="hs-varid">a</span><br>
etc.<br><br>And, along with it, an untyped counterpart:<br><br><span class="hs-comment">-- | An untyped term.</span><br><a name="line-231"></a><a name="UE"></a><span class="hs-keyword">data</span> <span class="hs-conid">UE</span><br>
<a name="line-232"></a>  <span class="hs-keyglyph">=</span> <span class="hs-conid">UVRef</span> <span class="hs-conid">UV</span><br><a name="line-233"></a>  <span class="hs-keyglyph">|</span> <span class="hs-conid">UConst</span> <span class="hs-conid">Const</span><br>
<a name="line-234"></a>  <span class="hs-keyglyph">|</span> <span class="hs-conid">UCast</span>  <span class="hs-conid">Type</span> <span class="hs-conid">UE</span><br><a name="line-235"></a>  <span class="hs-keyglyph">|</span> <span class="hs-conid">UAdd</span>   <span class="hs-conid">UE</span> <span class="hs-conid">UE</span><br>
etc.<br><br>What that for? What&#39;s the use of having beautiful GADT if you have to maintain an untyped ADT aside??<br><br>Corentin<br></pre><br><br>