<html><body>This smells like homework to me,<br>which isn't a bad thing,<br>it will however change the way I answer you.<br><br>Please look at http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-List.html#v:permutations<br>and show us your attempts to use this function.<br><br>Timothy<br><p><br>---------- Původní zpráva ----------<br>Od: Rune Harder Bak &lt;rune@bak.dk&gt;<br>Datum: 17. 11. 2012<br>Předmět: [Haskell-cafe] List all multiply/add combinations</p><blockquote>Given a list of numbers of fixed length I need to list all possible<br>values (and the associated computation) you get by<br>inserting +,-,*,/ between the numbers, and also set parentheses where<br>you please.<br>It shouldn't list computations with unnecessary parentheses.<br>Example list of length 3 [a,b,c] and only with + and *:<br>a*b+c, a*(b+c),a*b*c,a+b*c,(a+b)*c,a+b+c<br><br>What would be a good way to do this, and a good representation in Haskell?<br><br>Best,<br>Rune<br><br>_______________________________________________<br>Haskell-Cafe mailing list<br>Haskell-Cafe@haskell.org<br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a></blockquote></body></html>