Safe Haskell | None |
---|---|
Language | Haskell2010 |
- Module: Reflex.Process.GHCi
- Description: Run GHCi processes in a reflex application
Synopsis
- ghci :: (TriggerEvent t m, PerformEvent t m, MonadIO (Performable m), PostBuild t m, MonadIO m, MonadFix m, MonadHold t m) => CreateProcess -> Maybe ByteString -> Event t () -> m (Ghci t)
- ghciWatch :: (TriggerEvent t m, PerformEvent t m, MonadIO (Performable m), PostBuild t m, MonadIO m, MonadFix m, MonadHold t m) => CreateProcess -> Maybe ByteString -> m (Ghci t)
- data Ghci t = Ghci {
- _ghci_moduleOut :: Event t ByteString
- _ghci_moduleErr :: Event t ByteString
- _ghci_execOut :: Event t ByteString
- _ghci_execErr :: Event t ByteString
- _ghci_reload :: Event t ()
- _ghci_status :: Dynamic t Status
- _ghci_process :: Process t ByteString ByteString
- data Status
- moduleOutput :: (Reflex t, MonadFix m, MonadHold t m) => Behavior t Bool -> Ghci t -> m (Dynamic t ByteString)
- execOutput :: (Reflex t, MonadFix m, MonadHold t m) => Behavior t Bool -> Ghci t -> m (Dynamic t ByteString)
- collectOutput :: (Reflex t, MonadFix m, MonadHold t m) => Event t () -> Event t ByteString -> m (Dynamic t ByteString)
- statusMessage :: IsString a => Status -> a
Documentation
:: (TriggerEvent t m, PerformEvent t m, MonadIO (Performable m), PostBuild t m, MonadIO m, MonadFix m, MonadHold t m) | |
=> CreateProcess | Command to run to enter GHCi |
-> Maybe ByteString | Expression to evaluate whenever GHCi successfully loads modules |
-> Event t () | Ask GHCi to reload |
-> m (Ghci t) |
Runs a GHCi process and reloads it whenever the provided event fires
ghciWatch :: (TriggerEvent t m, PerformEvent t m, MonadIO (Performable m), PostBuild t m, MonadIO m, MonadFix m, MonadHold t m) => CreateProcess -> Maybe ByteString -> m (Ghci t) Source #
Run a GHCi process that watches for changes to Haskell source files in the current directory and reloads if they are modified
The output of the GHCi process
Ghci | |
|
The state of the GHCi process
Status_Initializing | |
Status_Loading | |
Status_LoadFailed | |
Status_LoadSucceeded | |
Status_Executing | |
Status_ExecutionFailed | |
Status_ExecutionSucceeded |
:: (Reflex t, MonadFix m, MonadHold t m) | |
=> Behavior t Bool | Whether to clear the output on reload |
-> Ghci t | |
-> m (Dynamic t ByteString) |
Collect all the GHCi module output (i.e., errors, warnings, etc) and optionally clear every time GHCi reloads
:: (Reflex t, MonadFix m, MonadHold t m) | |
=> Behavior t Bool | Whether to clear the output on reload |
-> Ghci t | |
-> m (Dynamic t ByteString) |
Collect all the GHCi expression output (i.e., the output of the called function) and optionally clear every time GHCi reloads
:: (Reflex t, MonadFix m, MonadHold t m) | |
=> Event t () | Clear output |
-> Event t ByteString | Output to add |
-> m (Dynamic t ByteString) |
Collect output, appending new output to the end of the accumulator
statusMessage :: IsString a => Status -> a Source #
Describe the current status of GHCi in a human-readable way