Skip to content

Instantly share code, notes, and snippets.

@fujimura
Created October 27, 2015 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujimura/f2ae8857e866231b6d32 to your computer and use it in GitHub Desktop.
Save fujimura/f2ae8857e866231b6d32 to your computer and use it in GitHub Desktop.
Interactive process in haskell
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