Copyright | (c) Alice Rixte 2024 |
---|---|
License | BSD 3 |
Maintainer | alice.rixte@u-bordeaux.fr |
Stability | unstable |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
System.Process.Ghci
Description
Run GHCi as a process, and execute commands.
Usage
>>>
ghci <- startGhci Quiet "ghci" []
>>>
execGhciCmd ghci Quiet "1+2"
GhciResult {ghciErr = "", ghciOut = "3"}
Synopsis
- data Ghci = Ghci {}
- startGhci :: Verbosity -> String -> [String] -> IO Ghci
- data GhciResult = GhciResult {}
- execGhciCmd :: Ghci -> Verbosity -> String -> IO GhciResult
Documentation
A GHCi process
Constructors
Ghci | |
Fields
|
Arguments
:: Verbosity | When |
-> String | The command to run (e.g. "ghci", "cabal" or "stack") |
-> [String] | The list of the command's arguments (e.g. "repl" for "cabal" or "ghci" for "stack") |
-> IO Ghci |
Start a GHCi process.
>>>
ghci = startGhci Normal "ghci" []
>>>
ghci = startGhci Loud "stack" ["ghci"]
data GhciResult Source #
The result printed by GHCi.
Constructors
GhciResult | |
Instances
Arguments
:: Ghci | A GHCi process |
-> Verbosity | When |
-> String | The command to execute |
-> IO GhciResult | The result of the execution |
Sends a command to ghci and wait for its result.
>>>
execGhciCmd ghci Normal "1+2"
GhciResult {ghciErr = "", ghciOut = "3"}