ghc-mod/Lang.hs

15 lines
358 B
Haskell
Raw Normal View History

2010-04-02 05:40:06 +00:00
module Lang where
import Control.Applicative
import Param
import System.IO
import System.Process
listLanguages :: Options -> IO String
listLanguages opt = convert opt . lines <$> getLangs opt
getLangs :: Options -> IO String
getLangs opt = do
(_,hout,_,_) <- runInteractiveProcess (ghc opt) ["--supported-languages"] Nothing Nothing
hGetContents hout