<span style="font-family: courier new,monospace;">How can I make a generic permutations function?<br><br>-- boolean permutations</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">bpms :: Int $B"*(B [[Bool]]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">bpms 0 = [[]]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">bpms n = map (False:) bss ++ map (True:) bss</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bss = bpms (n - 1)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-- generic</span> permutations<br>pms a :: Int <span style="font-family: courier new,monospace;">$B"*(B [[a]]<br><br>Best Regards,<br>
Cetin Sert<br></span>