X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FInteractiveUI.hs;h=143fb6afd99523efd2b10d1e53d24ced193bad75;hb=a271ad7e6d2b92779a63ab1cc88bc95dc17d6981;hp=49a5b1cbace2a27f80b114899a5317b856e79062;hpb=98688c6e8fd33f31c51218cf93cbf03fe3a5e73d;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index 49a5b1c..143fb6a 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,10 +1,10 @@ {-# OPTIONS -#include "Linker.h" #-} ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.161 2003/10/09 11:58:53 simonpj Exp $ +-- $Id: InteractiveUI.hs,v 1.193 2005/03/08 09:47:43 simonpj Exp $ -- -- GHC Interactive User Interface -- --- (c) The GHC Team 2000 +-- (c) The GHC Team 2004 -- ----------------------------------------------------------------------------- module InteractiveUI ( @@ -12,37 +12,28 @@ module InteractiveUI ( ghciWelcomeMsg ) where -#include "../includes/config.h" #include "HsVersions.h" import CompManager -import HscTypes ( TyThing(..), HomeModInfo(hm_linkable), HomePackageTable, - isObjectLinkable, GhciMode(..) ) -import HsSyn ( TyClDecl(..), ConDecl(..), Sig(..) ) -import IfaceSyn ( IfaceDecl( ifName ) ) +import HscTypes ( GhciMode(..) ) +import IfaceSyn ( IfaceDecl(..), IfaceClassOp(..), IfaceConDecls(..), + IfaceConDecl(..), IfaceType, + pprIfaceDeclHead, pprParendIfaceType, + pprIfaceForAllPart, pprIfaceType ) +import FunDeps ( pprFundeps ) import DriverFlags import DriverState import DriverUtil ( remove_spaces ) import Linker ( showLinkerState, linkPackages ) import Util -import IdInfo ( GlobalIdDetails(..) ) -import Id ( isImplicitId, idName, globalIdDetails ) -import Class ( className ) -import TyCon ( tyConName, tyConClass_maybe, isPrimTyCon, DataConDetails(..) ) -import DataCon ( dataConName ) -import FieldLabel ( fieldLabelTyCon ) -import SrcLoc ( isGoodSrcLoc ) -import Module ( showModMsg, lookupModuleEnv ) -import Name ( Name, isHomePackageName, nameSrcLoc, nameOccName, - NamedThing(..) ) -import OccName ( isSymOcc ) -import BasicTypes ( defaultFixity, SuccessFlag(..) ) -import Packages +import Name ( Name, NamedThing(..) ) +import OccName ( OccName, parenSymOcc, occNameUserString ) +import BasicTypes ( StrictnessMark(..), defaultFixity, SuccessFlag(..) ) import Outputable -import CmdLineOpts ( DynFlag(..), DynFlags(..), getDynFlags, saveDynFlags, - restoreDynFlags, dopt_unset ) +import CmdLineOpts ( DynFlags(..), DynFlag(..), dopt ) import Panic hiding ( showException ) import Config +import SrcLoc ( SrcLoc, isGoodSrcLoc ) #ifndef mingw32_HOST_OS import DriverUtil( handle ) @@ -52,7 +43,7 @@ import System.Posix #endif #endif -#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS +#ifdef USE_READLINE import Control.Concurrent ( yield ) -- Used in readline loop import System.Console.Readline as Readline #endif @@ -61,19 +52,24 @@ import System.Console.Readline as Readline import Control.Exception as Exception import Data.Dynamic -import Control.Concurrent +-- import Control.Concurrent import Numeric import Data.List +import Data.Int ( Int64 ) import System.Cmd import System.CPUTime import System.Environment +import System.Exit ( exitWith, ExitCode(..) ) import System.Directory -import System.IO as IO +import System.IO +import System.IO.Error as IO import Data.Char import Control.Monad as Monad +import Foreign.StablePtr ( newStablePtr ) import GHC.Exts ( unsafeCoerce# ) +import GHC.IOBase ( IOErrorType(InvalidArgument) ) import Data.IORef ( IORef, newIORef, readIORef, writeIORef ) @@ -81,12 +77,12 @@ import System.Posix.Internals ( setNonBlockingFD ) ----------------------------------------------------------------------------- -ghciWelcomeMsg = "\ -\ ___ ___ _\n\ -\ / _ \\ /\\ /\\/ __(_)\n\ -\ / /_\\// /_/ / / | | GHC Interactive, version " ++ cProjectVersion ++ ", for Haskell 98.\n\ -\/ /_\\\\/ __ / /___| | http://www.haskell.org/ghc/\n\ -\\\____/\\/ /_/\\____/|_| Type :? for help.\n" +ghciWelcomeMsg = + " ___ ___ _\n"++ + " / _ \\ /\\ /\\/ __(_)\n"++ + " / /_\\// /_/ / / | | GHC Interactive, version " ++ cProjectVersion ++ ", for Haskell 98.\n"++ + "/ /_\\\\/ __ / /___| | http://www.haskell.org/ghc/\n"++ + "\\____/\\/ /_/\\____/|_| Type :? for help.\n" GLOBAL_VAR(commands, builtin_commands, [(String, String -> GHCi Bool)]) @@ -105,6 +101,7 @@ builtin_commands = [ ("set", keepGoing setCmd), ("show", keepGoing showCmd), ("type", keepGoing typeOfExpr), + ("kind", keepGoing kindOfType), ("unset", keepGoing unsetOptions), ("undef", keepGoing undefineMacro), ("quit", quit) @@ -119,48 +116,60 @@ keepGoingPaths a str = a (toArgs str) >> return False shortHelpText = "use :? for help.\n" -- NOTE: spaces at the end of each line to workaround CPP/string gap bug. -helpText = "\ -\ Commands available from the prompt:\n\ -\\n\ -\ evaluate/run \n\ -\ :add ... add module(s) to the current target set\n\ -\ :browse [*] display the names defined by \n\ -\ :cd change directory to \n\ -\ :def define a command :\n\ -\ :help, :? display this list of commands\n\ -\ :info [ ...] display information about the given names\n\ -\ :load ... load module(s) and their dependents\n\ -\ :module [+/-] [*] ... set the context for expression evaluation\n\ -\ :reload reload the current module set\n\ -\\n\ -\ :set