One possible way to generate the values would be using a generic function for permutation with repetition, such as:<br><span style="font-family: monospace;"><br></span>permuteRep :: [a] -&gt; [b] -&gt; [[(a,b)]]<span style="font-family: monospace;">
<br></span>permuteRep []     _  =        []<span style="font-family: monospace;"><br></span>permuteRep (a:[]) bs =        [ [ (a,b)                           ] | b &lt;- bs ]<span style="font-family: monospace;"><br></span>
permuteRep (a:as) bs = concat [ [ (a,b):p | p &lt;- permuteRep as bs ] | b &lt;- bs ]<br><br>and then use:<br><br>lines = permuteRep [&quot;x&quot;,&quot;y&quot;,&quot;z&quot;] [False,True]<br><br>In case the variable names can be discarded (or, in this case, not generated ... lazy evaluation rox ;-), then:
<br><br>map (map snd) lines<br><br>This avoids having to provide a &quot;domain&quot; for each variable in the list comprehension, which could be problematic when dealing with many variables<br><br><div><span class="gmail_quote">
On 2/21/07, <b class="gmail_sendername">Joe Thornber</b> &lt;<a href="mailto:joe.thornber@gmail.com">joe.thornber@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;">
&gt; On 2/10/07, Peter Berry &lt;<a href="mailto:pwberry@gmail.com">pwberry@gmail.com</a>&gt; wrote:<br>&gt; Prelude&gt; putStrLn $ concatMap (flip (++)&quot;\n&quot;) $ map show $ [(x,y,(&amp;&amp;) x y)<br>&gt; |x &lt;- [True,False],y &lt;- [True,False]]
<br><br>This can be simplified slightly to:<br><br>Prelude &gt; putStrLn . unlines . map show $ [(x, y, x &amp;&amp; y) | x &lt;-<br>[True, False], y &lt;- [True, False]]<br><br><br>- Joe<br>_______________________________________________
<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Ricardo Guimarães Herrmann<br>&quot;Those who do not understand Lisp are doomed to reinvent it, poorly&quot;<br>&quot;Curried food and curried functions are both acquired tastes&quot;
<br>&quot;If you think good architecture is expensive, try bad architecture&quot;