Hi Daniel,<br><br>A more functional approach might be:<br><br>&nbsp;&nbsp;&nbsp; type Substitution = String -&gt; Maybe Value<br>&nbsp;&nbsp;&nbsp; single :: String -&gt; Value -&gt; Substitution<br>&nbsp;&nbsp;&nbsp; table&nbsp; :: Table -&gt; Substitution<br><br>&nbsp;&nbsp;&nbsp; substitute :: Substitution -&gt; Tree -&gt; Tree<br>
<br>For better performance and a lot more features, you could switch to<br><br>&nbsp;&nbsp;&nbsp; type Substitution = Data.Map String Value<br><br>- Conal<br><br><div class="gmail_quote">On Fri, Feb 13, 2009 at 2:40 AM, Daniel Kraft <span dir="ltr">&lt;d@domob.eu&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">Colin Adams wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If you have two functions that do two different things, then they<br>
certainly OUGHT to have different names.<br>
</blockquote>
<br></div>
Well, they do &quot;the same thing&quot; but for different arguments; it&#39;s like this:<br>
<br>
Table is a table of name-value pairs I want to substitute in a tree-like structure using:<br>
<br>
substitute :: Table -&gt; Tree -&gt; Tree<br>
<br>
For substituting a single name-value pair I want to define this utitlity routine so I don&#39;t have to construct a Table all the time in the user code:<br>
<br>
substitute :: String -&gt; Value -&gt; Tree -&gt; Tree<br>
<br>
In the case I believe it would certainly be good to be able to name both functions the same, but I fear I can not do so? &nbsp;There are languages where this is explicitelly allowed (e.g. C++ or Java), so I don&#39;t think it is such an unuseful or evil thing.<div>
<div></div><div class="Wj3C7c"><br>
<br>
Daniel<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>