Safe Haskell | None |
---|---|
Language | Haskell2010 |
Library for spawning and working with Ghci sessions.
- data Ghci
- data GhciError = UnexpectedExit String String
- data Stream
- data Load
- = Loading {
- loadModule :: String
- loadFile :: FilePath
- | Message {
- loadSeverity :: Severity
- loadFile :: FilePath
- loadFilePos :: (Int, Int)
- loadMessage :: [String]
- = Loading {
- data Severity
- startGhci :: String -> Maybe FilePath -> (Stream -> String -> IO ()) -> IO (Ghci, [Load])
- stopGhci :: Ghci -> IO ()
- interrupt :: Ghci -> IO ()
- process :: Ghci -> ProcessHandle
- execStream :: Ghci -> String -> (Stream -> String -> IO ()) -> IO ()
- showModules :: Ghci -> IO [(String, FilePath)]
- reload :: Ghci -> IO [Load]
- exec :: Ghci -> String -> IO [String]
- quit :: Ghci -> IO ()
Documentation
GHCi shut down
The stream Ghci is talking over.
Load messages
Loading | |
| |
Message | |
|
Severity of messages
startGhci :: String -> Maybe FilePath -> (Stream -> String -> IO ()) -> IO (Ghci, [Load]) Source #
Start GHCi, returning a function to perform further operation, as well as the result of the initial loading.
If you do not call stopGhci
then the underlying process may be leaked.
The callback will be given the messages produced while loading, useful if invoking something like "cabal repl"
which might compile dependent packages before really loading.
stopGhci :: Ghci -> IO () Source #
Stop GHCi. Attempts to interrupt and execute :quit:
, but if that doesn't complete
within 5 seconds it just terminates the process.
interrupt :: Ghci -> IO () Source #
Interrupt Ghci, stopping the current computation (if any), but leaving the process open to new input.
process :: Ghci -> ProcessHandle Source #
Obtain the progress handle behind a GHCi instance.
execStream :: Ghci -> String -> (Stream -> String -> IO ()) -> IO () Source #
Execute a command, calling a callback on each response. The callback will be called single threaded.
showModules :: Ghci -> IO [(String, FilePath)] Source #
List the modules currently loaded, with module name and source file.