<div> </div>
<div>I am writing a Java program with a call to a Haskell module M.hs,</div>
<div>in order to evaluate some expression expr.</div>
<div> </div>
<div>A very simple idea, which I got somewhere in the net, is to create a </div>
<div>Process object p which executes a GHC command-line instruction:</div>
<div> </div>
<div>Process p = Runtime.getRuntime();</div>
<div>p.exec( " ghc M.hs -e \"expr\" " );</div>
<div> </div>
<div> </div>
<div>This would be very simple, if it worked...</div>
<div> </div>
<div> </div>
<div>My problem is that expressions i want to evaluate involve</div>
<div>strings, and GHC command-line 'ghc' misinterprets some special symbols when it parses double quoted strings. </div>
<div> </div>
<div>For instance,</div>
<div> ghc -e " reverse \"2<3\" " gives an error!</div>
<div> </div>
<div>Thus any one know a simple way around this?</div>
<div> </div>
<div>The only one obvious to me is to create a temporary</div>
<div>Haskell module M_tmp.hs, with the expression to be evaluated,</div>
<div>which is then executed through a command-line instruction</div>
<div>like</div>
<div> ghc M_tmp.hs -e main</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>