Hi,<br><br>I am attempting to mimic matlab/octave using ghci, including a facility for updateable graphs of data.<br><br>1) It would be nice to be able to load a script of commands from the prompt<br><br>\begin{file}<br><br>
script Sine where<br><br>import &quot;hmatrix&quot; Numeric.Vector<br>import &quot;plot&quot; Graphics.Rendering.Plot<br><br>let ts = linspace 1000 (0,1 :: Double)<br>let ss = sin (15*2*pi*ts) -- 15 Hz sine wave<br><br>figure1 &lt;- display $ plot (ts,[line ss blue])<br>
<br>\end{file}<br><br>The idea is (apart from the import commands) is each line is equivalent to an input line in ghci.  Note that the last line binds a variable from an action in the top level IO monad, something not possible in a module.<br>
<br>2) It would be nice to have multiline inputs if the parser can tell that the input is incomplete rather than malformed.  One case is an empty &#39;do&#39; construct:<br><br>\begin{interaction}<br><br>Prelude&gt; :load Sine<br>
Sine&gt; :show bindings<br>ts :: Data.Vector.Storable Double<br>ss :: Data.Vector.Storable Double<br>figure :: Graphics.Rendering.Plot.Figure.Figure ()<br>Sine&gt; withFigureMVar figure1 $ do<br>     Figure a &gt;                           withTitle $ do<br>
     Text a &gt;                                             setText &quot;15 Hz sine wave&quot;<br>     Text a &gt;                                             setFontSize 16<br>     Text a &gt;                                    <br>
     Figure a &gt;<br>Sine&gt; <br><br>\end{interaction}<br><br>(an empty line ends the &#39;do&#39; construct and returns to next higher level).<br><br>Is this a feasible addition to GHCi?  This way the full power of GHCi is accessible to an interactive mathematics session rather than developing a custom interface on top of the GHC API.<br>
<br>Vivian<br>