<p>Ae you looking to do this in a web application, or client-side?  Since one of your requirements is to display a typeset equation, that makes a bit of difference.  In a web-based setting, the best way to do that is probably MathML, whereas a GUI will be a bit harder.</p>

<div class="gmail_quote">On Jun 9, 2011 8:24 AM, &quot;Jacek Generowicz&quot; &lt;<a href="mailto:jacek.generowicz@cern.ch">jacek.generowicz@cern.ch</a>&gt; wrote:<br type="attribution">&gt; Greetings Cafe,<br>&gt; <br>&gt; What would you recommend as a Haskell-based means of interactively  <br>
&gt; reading and writing mathematical formulae?<br>&gt; <br>&gt; As a toy example, what might I use to write a program which presents  <br>&gt; the user with<br>&gt; <br>&gt;      Please simplify the expression: \pi x^2 + 3\pi x^2<br>
&gt; <br>&gt; (Where the TeX-style expression would be presented with a greek pi and  <br>&gt; superscript twos on the xs.)<br>&gt; <br>&gt; The user should then have the ability to reply with something that  <br>&gt; looks like the result of TeXing<br>
&gt; <br>&gt;      5 \pi x^2<br>&gt; <br>&gt; Whatever means the user uses to enter this expression, he should be  <br>&gt; able to preview the &quot;typeset&quot; version of his input before submitting.<br>&gt; <br>&gt; Any ideas?<br>
&gt; <br>&gt; Thanks.<br>&gt; <br>&gt; <br>&gt; _______________________________________________<br>&gt; Haskell-Cafe mailing list<br>&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div>