One way woul be to represent them usnig a data structure. If it&#39;s only artihmetic operations, it should be pretty easy.<br><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">data Arith = Var String</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">           | Plus Artih Arith</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">           | Mult Arith Arith</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">           | Pow  Arith Arith</span><br><br>x + y would be Plus (Var &quot;x&quot;) (Var &quot;y&quot;), so on so forth..<br><br>You can even use infix constructors like :+:, :*:, :^:<br>
<br><br><div class="gmail_quote">On 4 June 2010 16:37, Martin Drautzburg <span dir="ltr">&lt;<a href="mailto:Martin.Drautzburg@web.de">Martin.Drautzburg@web.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Dear all,<br>
<br>
If I have a problem where I have to select from a set of operations, how would<br>
I print the result?<br>
<br>
Example: If I can chose from (x+y), (x*y), (x^2+y)...<br>
and I feed them all into my problem solver<br>
and it finds that &quot;(x*y) is right&quot;, how can I print that string?<br>
<font color="#888888"><br>
--<br>
Martin<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" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Ozgur Akgun<br>