<br><br><div><span class="gmail_quote">On 2/10/07, <b class="gmail_sendername">Peter Berry</b> &lt;<a href="mailto:pwberry@gmail.com">pwberry@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sigh, I seem to have done a reply to sender. Reposting to the list.<br><br>On 06/02/07, <a href="mailto:phiroc@free.fr">phiroc@free.fr</a> &lt;<a href="mailto:phiroc@free.fr">phiroc@free.fr</a>&gt; wrote:<br>&gt; Hello,<br>
&gt;<br>&gt; I would like to create a Haskell function that generates a truth table, for<br>&gt; all Boolean values, say, using the following &quot;and&quot; function :<br>&gt;<br>&gt; and :: Bool -&gt; Bool -&gt; Bool<br>
&gt; and a b = a &amp;&amp; b</blockquote><div><br>
<br>
<br>
This is solution that I used with list comprehension.. combining some
of the other ideas on the thread such as a tuple to see the original
values and then the result.<br>
</div><br>Prelude&gt; putStrLn $ concatMap (flip (++)&quot;\n&quot;) $ map show $
[(x,y,(&amp;&amp;) x y) |x &lt;- [True,False],y &lt;- [True,False]]<br>
(True,True,True)<br>
(True,False,False)<br>
(False,True,False)<br>
(False,False,False)<br>
<br>
gene<br></div><br>