<br><br><div class="gmail_quote">On Tue, Nov 6, 2012 at 12:45 AM, Oscar Benjamin <span dir="ltr">&lt;<a href="mailto:oscar.j.benjamin@gmail.com" target="_blank">oscar.j.benjamin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 5 November 2012 21:00, Daniel Fischer wrote<br><div class="im"></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
&gt; and the former is not even correct, because there is exactly one permutation<br>
&gt; of an empty list.<br>
<br>
</div>I&#39;m trying to convince myself that this is logically necessary but it<br>
still seems consistent in my mind that the set of permutations of an<br>
empty list is empty. I guess maybe if you posit that a sequence should<br>
always be contained by the set of its permutations then you reach this<br>
conclusion.<br></blockquote><div><br>A permutation of a set is a bijection from the set to itself. There is one map from the empty set to itself, the empty map, that is a bijection.<br><br>The number of permutations of a set of n elements is n!, and 0! = 1 should make you expect that there is one permutation of an empty set. <br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
&gt;<br>
&gt; Trace the execution of very simple cases (empty lists, singleton lists, lists<br>
&gt; with two elements) by hand with pencil and paper. That&#39;s the most instructive<br>
&gt; and fruitful way.<br>
&gt;<br>
&gt; Check the results of simple cases against what you know the result ought to<br>
&gt; be.<br>
<br>
</div>I see what you mean now.<br>
<div class="im"><br>
&gt; Single-step through the evaluation of simple cases in the ghci debugger if<br>
&gt; necessary.<br>
<br>
</div>I need to work out how to use this. I&#39;ve just found why I was unable<br>
to use it before: it only works if the file is interpreted. The quick<br>
fix was to delete all files created by the compiler. Is there a way<br>
that I can tell ghci to just ignore those files and load my program as<br>
interpreted for debugging?<br>
<br>
You can<br></blockquote><div><br>ghci&gt; :load *ModuleName<br><br>to get it interpreted. <br></div></div><br>