send string to stack ghc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

send string to stack ghc

Paum B.
Hi List,

It is possibile to run:

stack ghc -- --interactive -XOverloadedStrings

and then send to it strings (commands) externally?
Thanks

paum

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: send string to stack ghc

Paul

Sure. I remember old days Tcl/Tk utility "expect" for such interactive scripting sessions. Open a pipes and communicate with process :) Today there are tools similar to "expect" for scripting command line utilities.

Also Emacs works with GHCi (interro) in such way. Also Dante IMHO. Visual Studio Code Haskelly and Haskerro, etc..



24.08.2018 14:58, Paum B. wrote:
Hi List,

It is possibile to run:

stack ghc -- --interactive -XOverloadedStrings

and then send to it strings (commands) externally?
Thanks

paum


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: send string to stack ghc

Paum B.
oh, thats good - thank you!

is there any example in bash?

thnx

On Fri, Aug 24, 2018 at 2:02 PM Paul <[hidden email]> wrote:

Sure. I remember old days Tcl/Tk utility "expect" for such interactive scripting sessions. Open a pipes and communicate with process :) Today there are tools similar to "expect" for scripting command line utilities.

Also Emacs works with GHCi (interro) in such way. Also Dante IMHO. Visual Studio Code Haskelly and Haskerro, etc..



24.08.2018 14:58, Paum B. wrote:
Hi List,

It is possibile to run:

stack ghc -- --interactive -XOverloadedStrings

and then send to it strings (commands) externally?
Thanks

paum


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: send string to stack ghc

Paum B.
Actually, I dont know if I have asked good question to what I need.
So, I would like to run the process:

stack ghc -- --interactive -XOverloadedStrings

and then, somehow from 'outside' push string commands to it...

On Fri, Aug 24, 2018 at 2:08 PM Paum B. <[hidden email]> wrote:
oh, thats good - thank you!

is there any example in bash?

thnx

On Fri, Aug 24, 2018 at 2:02 PM Paul <[hidden email]> wrote:

Sure. I remember old days Tcl/Tk utility "expect" for such interactive scripting sessions. Open a pipes and communicate with process :) Today there are tools similar to "expect" for scripting command line utilities.

Also Emacs works with GHCi (interro) in such way. Also Dante IMHO. Visual Studio Code Haskelly and Haskerro, etc..



24.08.2018 14:58, Paum B. wrote:
Hi List,

It is possibile to run:

stack ghc -- --interactive -XOverloadedStrings

and then send to it strings (commands) externally?
Thanks

paum


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: send string to stack ghc

David McBride
You should be able to run something like this:

echo 'putStrLn "hi"' | stack exec -- ghci -XOverloadedStrings

On Fri, Aug 24, 2018 at 8:21 AM, Paum B. <[hidden email]> wrote:
Actually, I dont know if I have asked good question to what I need.
So, I would like to run the process:

stack ghc -- --interactive -XOverloadedStrings

and then, somehow from 'outside' push string commands to it...

On Fri, Aug 24, 2018 at 2:08 PM Paum B. <[hidden email]> wrote:
oh, thats good - thank you!

is there any example in bash?

thnx

On Fri, Aug 24, 2018 at 2:02 PM Paul <[hidden email]> wrote:

Sure. I remember old days Tcl/Tk utility "expect" for such interactive scripting sessions. Open a pipes and communicate with process :) Today there are tools similar to "expect" for scripting command line utilities.

Also Emacs works with GHCi (interro) in such way. Also Dante IMHO. Visual Studio Code Haskelly and Haskerro, etc..



24.08.2018 14:58, Paum B. wrote:
Hi List,

It is possibile to run:

stack ghc -- --interactive -XOverloadedStrings

and then send to it strings (commands) externally?
Thanks

paum


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners



_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: send string to stack ghc

Paum B.
yes, nice.

but after the process is over. I need to hold it running (dtill the same one) until command  to end it.

again, thankx!



On Fri, Aug 24, 2018 at 2:28 PM David McBride <[hidden email]> wrote:
You should be able to run something like this:

echo 'putStrLn "hi"' | stack exec -- ghci -XOverloadedStrings

On Fri, Aug 24, 2018 at 8:21 AM, Paum B. <[hidden email]> wrote:
Actually, I dont know if I have asked good question to what I need.
So, I would like to run the process:

stack ghc -- --interactive -XOverloadedStrings

and then, somehow from 'outside' push string commands to it...

On Fri, Aug 24, 2018 at 2:08 PM Paum B. <[hidden email]> wrote:
oh, thats good - thank you!

is there any example in bash?

thnx

On Fri, Aug 24, 2018 at 2:02 PM Paul <[hidden email]> wrote:

Sure. I remember old days Tcl/Tk utility "expect" for such interactive scripting sessions. Open a pipes and communicate with process :) Today there are tools similar to "expect" for scripting command line utilities.

Also Emacs works with GHCi (interro) in such way. Also Dante IMHO. Visual Studio Code Haskelly and Haskerro, etc..



24.08.2018 14:58, Paum B. wrote:
Hi List,

It is possibile to run:

stack ghc -- --interactive -XOverloadedStrings

and then send to it strings (commands) externally?
Thanks

paum


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: send string to stack ghc

Paul
In reply to this post by David McBride

This are listing expect alternatives: https://en.wikipedia.org/wiki/Expect  Btw, it's easy to be done in Python.

Also my IMHO that better is to pass extension directives not in command line (it will be big) but in custom .ghci file with option "-ghci-script".


24.08.2018 15:27, David McBride wrote:
You should be able to run something like this:

echo 'putStrLn "hi"' | stack exec -- ghci -XOverloadedStrings

On Fri, Aug 24, 2018 at 8:21 AM, Paum B. <[hidden email]> wrote:
Actually, I dont know if I have asked good question to what I need.
So, I would like to run the process:

stack ghc -- --interactive -XOverloadedStrings

and then, somehow from 'outside' push string commands to it...

On Fri, Aug 24, 2018 at 2:08 PM Paum B. <[hidden email]> wrote:
oh, thats good - thank you!

is there any example in bash?

thnx

On Fri, Aug 24, 2018 at 2:02 PM Paul <[hidden email]> wrote:

Sure. I remember old days Tcl/Tk utility "expect" for such interactive scripting sessions. Open a pipes and communicate with process :) Today there are tools similar to "expect" for scripting command line utilities.

Also Emacs works with GHCi (interro) in such way. Also Dante IMHO. Visual Studio Code Haskelly and Haskerro, etc..



24.08.2018 14:58, Paum B. wrote:
Hi List,

It is possibile to run:

stack ghc -- --interactive -XOverloadedStrings

and then send to it strings (commands) externally?
Thanks

paum


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners




_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: send string to stack ghc

Paum B.
many thanks, I have found what I need -> http://empty.sourceforge.net/

paum

On Fri, Aug 24, 2018 at 2:37 PM Paul <[hidden email]> wrote:

This are listing expect alternatives: https://en.wikipedia.org/wiki/Expect  Btw, it's easy to be done in Python.

Also my IMHO that better is to pass extension directives not in command line (it will be big) but in custom .ghci file with option "-ghci-script".


24.08.2018 15:27, David McBride wrote:
You should be able to run something like this:

echo 'putStrLn "hi"' | stack exec -- ghci -XOverloadedStrings

On Fri, Aug 24, 2018 at 8:21 AM, Paum B. <[hidden email]> wrote:
Actually, I dont know if I have asked good question to what I need.
So, I would like to run the process:

stack ghc -- --interactive -XOverloadedStrings

and then, somehow from 'outside' push string commands to it...

On Fri, Aug 24, 2018 at 2:08 PM Paum B. <[hidden email]> wrote:
oh, thats good - thank you!

is there any example in bash?

thnx

On Fri, Aug 24, 2018 at 2:02 PM Paul <[hidden email]> wrote:

Sure. I remember old days Tcl/Tk utility "expect" for such interactive scripting sessions. Open a pipes and communicate with process :) Today there are tools similar to "expect" for scripting command line utilities.

Also Emacs works with GHCi (interro) in such way. Also Dante IMHO. Visual Studio Code Haskelly and Haskerro, etc..



24.08.2018 14:58, Paum B. wrote:
Hi List,

It is possibile to run:

stack ghc -- --interactive -XOverloadedStrings

and then send to it strings (commands) externally?
Thanks

paum


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners




_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners