display types simply unless "-l" option is given

This commit is contained in:
eagletmt
2012-02-13 20:31:36 +09:00
parent 7e45a03532
commit b11475821e
3 changed files with 20 additions and 16 deletions

View File

@@ -10,13 +10,21 @@ import GHC.Paths (libdir)
----------------------------------------------------------------
data OutputStyle = LispStyle | PlainStyle
data Options = Options {
convert :: [String] -> String
outputStyle :: OutputStyle
, hlintOpts :: [String]
, ghcOpts :: [String]
, operators :: Bool
}
convert :: Options -> [String] -> String
convert Options{outputStyle = LispStyle} ms = "(" ++ unwords quoted ++ ")\n"
where
quote x = "\"" ++ x ++ "\""
quoted = map quote ms
convert Options{outputStyle = PlainStyle} ms = unlines ms
withGHC :: (MonadPlus m) => Ghc (m a) -> IO (m a)
withGHC body = ghandle ignore $ runGhc (Just libdir) body
where