A 20/12/2012, às 13:16, Miguel Negrao escreveu:

> Writing long functions or expressions in emacs to be run in ghci is a bit 
> difficult because you can’t use the normal indentation rules (at least I 
> haven’t figured out how), so one possibility would be to just write those 
> functions in a .hs file and load the file to ghci, but every time one does 
> that the previous bindings are destroyed and loose access to the server that 
> we booted, and any resources on it, so that doesn’t work for interaction with 
> a sc server via hsc3-server. Does anyone have any tips about this ? Is it 
> possible somehow to load a file to ghci and keep the bindings or is there a 
> way to write haskell code with indentation based expression boundaries and 
> evaluate that in ghci ?

I’m happy to report that I’ve found that leksah has a quite nice and working 
interactive ghci pane. It has a window for writing code (a scratch buffer), 
where one can use indentation based rules, and it has another pane with all the 
variables defined so far. To evaluate code one either selects a portion of code 
or puts the cursor on a line and hits ctrl-enter.  It feels very interactive.
         If I want to run multiple IO actions in ghci and bind the result to 
“variables” that I can use later, is this the best way ?

(engine,r,send) <- do
    engine <- MS.new withDefaultSynth
    let send a = MS.execute engine $ exec_ a
    r <- MS.execute engine rootNode
    return (engine, r, send)

best,
Miguel
_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to