Using GHC API.

This commit is contained in:
Kazu Yamamoto 2010-04-27 10:29:29 +09:00
parent 40bdc70f8b
commit 1e87b386a1
2 changed files with 3 additions and 10 deletions

11
Lang.hs
View File

@ -1,14 +1,7 @@
module Lang where
import Control.Applicative
import Param
import System.IO
import System.Process
import DynFlags
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
listLanguages opt = return $ convert opt supportedLanguages

View File

@ -28,7 +28,7 @@ Executable ghc-mod
GHC-Options: -Wall -fno-warn-unused-do-bind
else
GHC-Options: -Wall
Build-Depends: base >= 4.0 && < 5,
Build-Depends: base >= 4.0 && < 5, ghc,
parsec >= 3, process, haskell-src-exts,
directory, filepath
Source-Repository head