info -> type.
This commit is contained in:
parent
9467a5d22e
commit
8760f6b714
@ -27,7 +27,7 @@ usage = "ghc-mod version 0.4.4\n"
|
|||||||
++ "\t ghc-mod [-l] lang\n"
|
++ "\t ghc-mod [-l] lang\n"
|
||||||
++ "\t ghc-mod [-l] browse <module> [<module> ...]\n"
|
++ "\t ghc-mod [-l] browse <module> [<module> ...]\n"
|
||||||
++ "\t ghc-mod check <HaskellFile>\n"
|
++ "\t ghc-mod check <HaskellFile>\n"
|
||||||
++ "\t ghc-mod info <HaskellFile> <expression>\n"
|
++ "\t ghc-mod type <HaskellFile> <expression>\n"
|
||||||
++ "\t ghc-mod [-h opt] lint <HaskellFile>\n"
|
++ "\t ghc-mod [-h opt] lint <HaskellFile>\n"
|
||||||
++ "\t ghc-mod boot\n"
|
++ "\t ghc-mod boot\n"
|
||||||
++ "\t ghc-mod help\n"
|
++ "\t ghc-mod help\n"
|
||||||
@ -74,7 +74,7 @@ main = flip catches handlers $ do
|
|||||||
"browse" -> concat <$> mapM (browseModule opt) (tail cmdArg)
|
"browse" -> concat <$> mapM (browseModule opt) (tail cmdArg)
|
||||||
"list" -> listModules opt
|
"list" -> listModules opt
|
||||||
"check" -> withFile (checkSyntax opt) (safelist cmdArg 1)
|
"check" -> withFile (checkSyntax opt) (safelist cmdArg 1)
|
||||||
"info" -> withFile (infoExpr opt (safelist cmdArg 2)) (safelist cmdArg 1)
|
"type" -> withFile (typeExpr opt (safelist cmdArg 2)) (safelist cmdArg 1)
|
||||||
"lint" -> withFile (lintSyntax opt) (safelist cmdArg 1)
|
"lint" -> withFile (lintSyntax opt) (safelist cmdArg 1)
|
||||||
"lang" -> listLanguages opt
|
"lang" -> listLanguages opt
|
||||||
"boot" -> do
|
"boot" -> do
|
||||||
|
8
Info.hs
8
Info.hs
@ -6,11 +6,11 @@ import Outputable
|
|||||||
import PprTyThing
|
import PprTyThing
|
||||||
import Types
|
import Types
|
||||||
|
|
||||||
infoExpr :: Options -> String -> String -> IO String
|
typeExpr :: Options -> String -> String -> IO String
|
||||||
infoExpr _ expr file = (++ "\n") <$> info file expr
|
typeExpr _ expr file = (++ "\n") <$> typeOf file expr
|
||||||
|
|
||||||
info :: String -> String -> IO String
|
typeOf :: String -> String -> IO String
|
||||||
info fileName expr = withGHC $ do
|
typeOf fileName expr = withGHC $ do
|
||||||
initSession []
|
initSession []
|
||||||
setTargetFile fileName
|
setTargetFile fileName
|
||||||
load LoadAllTargets
|
load LoadAllTargets
|
||||||
|
Loading…
Reference in New Issue
Block a user