Created
October 27, 2015 10:34
-
-
Save fujimura/f2ae8857e866231b6d32 to your computer and use it in GitHub Desktop.
Interactive process in haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Process | |
import System.IO | |
main :: IO () | |
main = do | |
(Just hi, Just ho, _, ph) <- createProcess (proc "ruby" ["-e", "f = gets; puts f "]) { std_in = CreatePipe, std_out = CreatePipe } | |
hPutStrLn hi "foobar" | |
hGetLine ho >>= print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment