<br><br><div><span class="gmail_quote">On 2/10/07, <b class="gmail_sendername">Peter Berry</b> <<a href="mailto:pwberry@gmail.com">pwberry@gmail.com</a>> 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> <<a href="mailto:phiroc@free.fr">phiroc@free.fr</a>> wrote:<br>> Hello,<br>
><br>> I would like to create a Haskell function that generates a truth table, for<br>> all Boolean values, say, using the following "and" function :<br>><br>> and :: Bool -> Bool -> Bool<br>
> and a b = a && 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> putStrLn $ concatMap (flip (++)"\n") $ map show $
[(x,y,(&&) x y) |x <- [True,False],y <- [True,False]]<br>
(True,True,True)<br>
(True,False,False)<br>
(False,True,False)<br>
(False,False,False)<br>
<br>
gene<br></div><br>