&gt; <span style="font-family:arial,sans-serif;font-size:13px">the result </span><span style="font-family:arial,sans-serif;font-size:13px">is of type [()] but for a cartesian n-product, you would like [[a]]</span><br style="font-family:arial,sans-serif;font-size:13px">

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Right. So what we have here is a product over a count of 0 sets, which is isomorphic to the function space that has the null set as domain. The latter has exactly one element: the trivial function.</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">My apologies for misreading what OP wrote:</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt; This looks to me to be a violation of the rule that the Cartesian</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">

<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">&gt; product of an empty list of lists is a list with one element i</span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">n</span><div style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">

&gt; it.</div></div><div><br></div><div>I thought he meant something along the lines of sequence [&quot;&quot;,&quot;x&quot;].</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra">

<br clear="all"><div>-- Kim-Ee</div>
<br><br><div class="gmail_quote">On Mon, Dec 24, 2012 at 4:42 PM, Chaddaï Fouché <span dir="ltr">&lt;<a href="mailto:chaddai.fouche@gmail.com" target="_blank">chaddai.fouche@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">

<div class="im">On Mon, Dec 24, 2012 at 8:01 AM, Jay Sulzberger &lt;<a href="mailto:jays@panix.com">jays@panix.com</a>&gt; wrote:<br>
&gt;<br>
&gt;   &gt; sequence []<br>
&gt;   []<br>
&gt;   it :: [()]<br>
&gt;<br>
&gt; This looks to me to be a violation of the rule that the Cartesian<br>
&gt; product of an empty list of lists is a list with one element in<br>
&gt; it.  It looks to be a violation because &quot;[]&quot; looks like a name<br>
&gt; for an empty list.  But we also have<br>
&gt;<br>
&gt;   &gt; length (sequence [])<br>
&gt;   1<br>
&gt;   it :: Int<br>
&gt;<br>
&gt; which almost reassures me.<br>
&gt;<br>
<br>
</div>Well the type of the first response is a dead give-away : the result<br>
is of type [()] but for a cartesian n-product, you would like [[a]]<br>
(with a maybe instantiated to a concrete type) ...<br>
What&#39;s happening here is that sequence is not &quot;the cartesian<br>
n-product&quot; in general, it is only that in the list monad but in<br>
&quot;sequence []&quot; there&#39;s nothing to indicate that we&#39;re in the list<br>
monad, so GHC default to the IO monad and unit () so sequence has the<br>
type &quot;[IO ()] -&gt; IO [()]&quot; and there&#39;s no IO action in the list<br>
parameter, so there&#39;s nothing in the result list.<br>
<br>
Try :<br>
&gt; sequence [] :: [[Int]]<br>
and you should be reassured.<br>
<br>
--<br>
Jedaï<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br></div>