<div>Hello, <br></div><div><br></div><div>I'm currently doing my first steps in Haskell with a calculator and I'm stuck at the parser. <br></div><div>I have a <i>data Term</i> which will build ... basically a tree of operations, and works fine.<br></div><div><br></div><div>I need help for the function <br></div><div>termify :: [Either Operator Term] -> Term<br></div><div><br></div><div>It takes operators (such as +,**) and terms and output a new, bigger term and is mostly trivial. <br></div><div>However, all attempts I've done for parsing brackets seem very ... crude and not like Haskell at all. <br></div><div><br></div><div>The very first pattern match should check for the innermost brackets, and return termify for everything in between.<br></div><div>I guess that I'm missing some really cool, haskelly solution here.<br></div><div> <br></div><div>Best Regards<br></div><div>Leonhard<br></div>