[haskell-art] hsc3-server interactive session was ANN: hsc3-process-0.8 and hsc3-server 0.5
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 haskell-art@lurk.org http://lists.lurk.org/mailman/listinfo/haskell-art
Re: [haskell-art] hsc3-server interactive session was ANN: hsc3-process-0.8 and hsc3-server 0.5
On Fri, 4 Jan 2013, Miguel Negrao wrote: 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. Thank you for this hint! 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) In GHCi you could just write Prelude engine - MS.new withDefaultSynth Prelude let send a = MS.execute engine $ exec_ a Prelude r - MS.execute engine rootNode But if you want to bundle all three actions, then your do-block is certainly the best way. ___ haskell-art mailing list haskell-art@lurk.org http://lists.lurk.org/mailman/listinfo/haskell-art
Re: [haskell-art] hsc3-server interactive session was ANN: hsc3-process-0.8 and hsc3-server 0.5
A 04/01/2013, às 17:35, Henning Thielemann escreveu: In GHCi you could just write Prelude engine - MS.new withDefaultSynth Prelude let send a = MS.execute engine $ exec_ a Prelude r - MS.execute engine rootNode But if you want to bundle all three actions, then your do-block is certainly the best way. Yes, I know that I can evaluate line by line, but that can get boring pretty fast. When doing interactive evaluation sometimes one wants to evaluate a group of statements and do multiple bindings, so yeah, I guess I have to do it that way then. A 04/01/2013, às 23:38, Luke Iannini escreveu: And just to note, it should be possible to add support for multi-line GHCi evaluation in emacs — you just need to wrap the lines being sent in :{ and :} (you can use those commands in ghci to write and run multiline code). The hsc3 mode in emacs also has multiline evaluation, that was not the issue, the issue was evaluating expressions that use the indentation rules (so no { } in do blocks, etc ). best, Miguel http://www.friendlyvirus.org/miguelnegrao/ ___ haskell-art mailing list haskell-art@lurk.org http://lists.lurk.org/mailman/listinfo/haskell-art
Re: [haskell-art] hsc3-server interactive session was ANN: hsc3-process-0.8 and hsc3-server 0.5
You can do multiline evaluation in ghci with regular indentation (without internal braces) by preceding and following up your code like this: Prelude :{ Prelude| do putStrLn first line Prelude| putStrLn second line Prelude| :} first line second line Prelude I use the tslime plugin in vim and this in my .vimrc to do it all in one keystroke, but I imagine you could also get emacs to add the braces for you: map F11 :call Send_to_Tmux(:{\n)CRvip:normal @gCR:call Send_to_Tmux(:}\n)CRk Best, Renick On Sat, Jan 5, 2013 at 9:20 AM, Miguel Negrao miguel.negrao-li...@friendlyvirus.org wrote: A 04/01/2013, às 17:35, Henning Thielemann escreveu: In GHCi you could just write Prelude engine - MS.new withDefaultSynth Prelude let send a = MS.execute engine $ exec_ a Prelude r - MS.execute engine rootNode But if you want to bundle all three actions, then your do-block is certainly the best way. Yes, I know that I can evaluate line by line, but that can get boring pretty fast. When doing interactive evaluation sometimes one wants to evaluate a group of statements and do multiple bindings, so yeah, I guess I have to do it that way then. A 04/01/2013, às 23:38, Luke Iannini escreveu: And just to note, it should be possible to add support for multi-line GHCi evaluation in emacs — you just need to wrap the lines being sent in :{ and :} (you can use those commands in ghci to write and run multiline code). The hsc3 mode in emacs also has multiline evaluation, that was not the issue, the issue was evaluating expressions that use the indentation rules (so no { } in do blocks, etc ). best, Miguel http://www.friendlyvirus.org/miguelnegrao/ ___ haskell-art mailing list haskell-art@lurk.org http://lists.lurk.org/mailman/listinfo/haskell-art -- Renick Bell - http://renickbell.net - http://twitter.com/renick - http://the3rd2nd.com ___ haskell-art mailing list haskell-art@lurk.org http://lists.lurk.org/mailman/listinfo/haskell-art
Re: [haskell-art] hsc3-server interactive session was ANN: hsc3-process-0.8 and hsc3-server 0.5
Sorry, I didn't read carefully. That's exactly what Luke was explaining... On Sat, Jan 5, 2013 at 9:37 AM, Renick Bell ren...@gmail.com wrote: You can do multiline evaluation in ghci with regular indentation (without internal braces) by preceding and following up your code like this: Prelude :{ Prelude| do putStrLn first line Prelude| putStrLn second line Prelude| :} first line second line Prelude I use the tslime plugin in vim and this in my .vimrc to do it all in one keystroke, but I imagine you could also get emacs to add the braces for you: map F11 :call Send_to_Tmux(:{\n)CRvip:normal @gCR:call Send_to_Tmux(:}\n)CRk Best, Renick On Sat, Jan 5, 2013 at 9:20 AM, Miguel Negrao miguel.negrao-li...@friendlyvirus.org wrote: A 04/01/2013, às 17:35, Henning Thielemann escreveu: In GHCi you could just write Prelude engine - MS.new withDefaultSynth Prelude let send a = MS.execute engine $ exec_ a Prelude r - MS.execute engine rootNode But if you want to bundle all three actions, then your do-block is certainly the best way. Yes, I know that I can evaluate line by line, but that can get boring pretty fast. When doing interactive evaluation sometimes one wants to evaluate a group of statements and do multiple bindings, so yeah, I guess I have to do it that way then. A 04/01/2013, às 23:38, Luke Iannini escreveu: And just to note, it should be possible to add support for multi-line GHCi evaluation in emacs — you just need to wrap the lines being sent in :{ and :} (you can use those commands in ghci to write and run multiline code). The hsc3 mode in emacs also has multiline evaluation, that was not the issue, the issue was evaluating expressions that use the indentation rules (so no { } in do blocks, etc ). best, Miguel http://www.friendlyvirus.org/miguelnegrao/ ___ haskell-art mailing list haskell-art@lurk.org http://lists.lurk.org/mailman/listinfo/haskell-art -- Renick Bell - http://renickbell.net - http://twitter.com/renick - http://the3rd2nd.com -- Renick Bell - http://renickbell.net - http://twitter.com/renick - http://the3rd2nd.com ___ haskell-art mailing list haskell-art@lurk.org http://lists.lurk.org/mailman/listinfo/haskell-art