{-# OPTIONS -#include "Linker.h" #-}
-----------------------------------------------------------------------------
--- $Id: InteractiveUI.hs,v 1.162 2003/12/10 14:15:21 simonmar Exp $
+-- $Id: InteractiveUI.hs,v 1.165 2004/04/05 11:14:30 simonpj Exp $
--
-- GHC Interactive User Interface
--
("set", keepGoing setCmd),
("show", keepGoing showCmd),
("type", keepGoing typeOfExpr),
+ ("kind", keepGoing kindOfType),
("unset", keepGoing unsetOptions),
("undef", keepGoing undefineMacro),
("quit", quit)
\ :show bindings show the current bindings made at the prompt\n\
\\n\
\ :type <expr> show the type of <expr>\n\
+\ :kind <type> show the kind of <type>\n\
\ :undef <cmd> undefine user-defined command :<cmd>\n\
\ :unset <option> ... unset options\n\
\ :quit exit GHCi\n\
Nothing -> return ()
Just tystr -> io (putStrLn tystr)
+kindOfType :: String -> GHCi ()
+kindOfType str
+ = do cms <- getCmState
+ maybe_tystr <- io (cmKindOfType cms str)
+ case maybe_tystr of
+ Nothing -> return ()
+ Just tystr -> io (putStrLn tystr)
+
quit :: String -> GHCi Bool
quit _ = return True
shellEscape str = io (system str >> return False)
-----------------------------------------------------------------------------
--- Browing a module's contents
+-- Browsing a module's contents
browseCmd :: String -> GHCi ()
browseCmd m =