Skip to content

Instantly share code, notes, and snippets.

@osa1
Created January 18, 2015 20:52
Show Gist options
  • Save osa1/87e873ee2fc8f746bfd4 to your computer and use it in GitHub Desktop.
Save osa1/87e873ee2fc8f746bfd4 to your computer and use it in GitHub Desktop.
module Main where
import qualified Data.ByteString as B
import Data.MessagePack (Object)
import Data.Serialize (decode)
import System.IO (hGetContents)
import System.Process
main :: IO ()
main = do
(_, Just hout, _, pHandle) <-
createProcess (proc "nvim" ["--api-info"]){ std_out = CreatePipe }
exitCode <- waitForProcess pHandle
putStrLn $ "Neovim exited with " ++ show exitCode
output <- B.hGetContents hout
print (decode output :: Either String Object)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment