On Sun, Nov 18, 2012 at 2:04 PM, Stefan Klinger <all-li...@stefan-klinger.de> wrote: > Sounds like you would want to enumerate all possible *abstract* syntax > trees, these implicitly have exactly the necessary parentheses. I'd do > this recursively, splitting the sequence of numbers in two at all > possible places, and then combine the corresponding results with all > possible operators.
That was my second idea, but just doing it naively resulted in many equivalent calculations, so I thought there might be a better way to view the problem. But as Artyom showed On Sat, Nov 17, 2012 at 11:37 PM, Artyom Kazak <artyom.ka...@gmail.com> wrote: > Indentation messed up… I have pasted the code here: http://hpaste.org/77864 enumerating the abstract syntax tree is actually (or at least could be) the way to go! Thanks a lot! What I need is a little bit different, but now I feel I'm on the right track! This is my first question to the café and it makes me a lot more certain using Haskell for production, when you can get this kind of quick and thorough help when in doubt. Great community! -Rune _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe