From 8760f6b7145b6388ae30ff0643ab0468640ac5c0 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Fri, 12 Nov 2010 16:32:20 +0900 Subject: [PATCH] info -> type. --- GHCMod.hs | 4 ++-- Info.hs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GHCMod.hs b/GHCMod.hs index 83b3f83..72e5f43 100644 --- a/GHCMod.hs +++ b/GHCMod.hs @@ -27,7 +27,7 @@ usage = "ghc-mod version 0.4.4\n" ++ "\t ghc-mod [-l] lang\n" ++ "\t ghc-mod [-l] browse [ ...]\n" ++ "\t ghc-mod check \n" - ++ "\t ghc-mod info \n" + ++ "\t ghc-mod type \n" ++ "\t ghc-mod [-h opt] lint \n" ++ "\t ghc-mod boot\n" ++ "\t ghc-mod help\n" @@ -74,7 +74,7 @@ main = flip catches handlers $ do "browse" -> concat <$> mapM (browseModule opt) (tail cmdArg) "list" -> listModules opt "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) "lang" -> listLanguages opt "boot" -> do diff --git a/Info.hs b/Info.hs index 7c4795e..6c7660e 100644 --- a/Info.hs +++ b/Info.hs @@ -6,11 +6,11 @@ import Outputable import PprTyThing import Types -infoExpr :: Options -> String -> String -> IO String -infoExpr _ expr file = (++ "\n") <$> info file expr +typeExpr :: Options -> String -> String -> IO String +typeExpr _ expr file = (++ "\n") <$> typeOf file expr -info :: String -> String -> IO String -info fileName expr = withGHC $ do +typeOf :: String -> String -> IO String +typeOf fileName expr = withGHC $ do initSession [] setTargetFile fileName load LoadAllTargets