Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data InterpState a
- emptyInterpreterState :: Monoid a => Ghci -> StartupConfig -> InterpState a
- startup :: String -> FilePath -> StartupConfig -> DaemonIO (InterpState ())
- data StartupConfig = StartupConfig {}
- quit :: InterpState a -> IO (InterpState a)
- exec :: Monoid a => Text -> InterpState a -> ExceptT DaemonError IO (InterpState a, [Text])
- execCleaned :: Monoid a => Text -> InterpState a -> ExceptT DaemonError IO (InterpState a, [Text])
- execMuted :: Monoid a => Text -> InterpState a -> ExceptT DaemonError IO (InterpState a)
- step :: Monoid a => InterpState a -> ExceptT DaemonError IO (InterpState a)
- stepInto :: Monoid a => Text -> InterpState a -> ExceptT DaemonError IO (InterpState a)
- load :: Monoid a => FilePath -> InterpState a -> DaemonIO (InterpState a)
- continue :: Monoid a => InterpState a -> DaemonIO (InterpState a)
- getBpInCurModule :: InterpState a -> [Int]
- getBpInFile :: FilePath -> InterpState a -> [Int]
- toggleBreakpointLine :: Monoid a => BreakpointArg -> InterpState a -> DaemonIO (InterpState a)
- setBreakpointLine :: Monoid a => BreakpointArg -> InterpState a -> DaemonIO (InterpState a)
- deleteBreakpointLine :: Monoid a => BreakpointArg -> InterpState a -> DaemonIO (InterpState a)
- trace :: Monoid a => InterpState a -> DaemonIO (InterpState a)
- history :: InterpState a -> DaemonIO (InterpState a, Either Text [Text])
- tabComplete :: Monoid a => Text -> InterpState a -> DaemonIO (InterpState a, (Text, [Text]))
- isExecuting :: InterpState a -> Bool
- data BreakpointArg
- run :: DaemonIO r -> IO (Either DaemonError r)
- type DaemonIO r = ExceptT DaemonError IO r
- data DaemonError
- data LogOutput
The interpreter state
data InterpState a Source #
Instances
Show (InterpState a) Source # | |
Defined in Ghcitui.Ghcid.Daemon showsPrec :: Int -> InterpState a -> ShowS # show :: InterpState a -> String # showList :: [InterpState a] -> ShowS # |
emptyInterpreterState :: Monoid a => Ghci -> StartupConfig -> InterpState a Source #
Create an empty/starting interpreter state.
Usually you don't want to call this directly. Instead use startup
.
Startup and shutdown
:: String | Command to run (e.g. "ghci" or "cabal repl") |
-> FilePath | Working directory to run the start up command in. |
-> StartupConfig | Where do we put the logging? |
-> DaemonIO (InterpState ()) | The newly created interpreter handle. |
Start up the GHCi Daemon.
quit :: InterpState a -> IO (InterpState a) Source #
Shut down the GHCi Daemon.
Base operations with the daemon
exec :: Monoid a => Text -> InterpState a -> ExceptT DaemonError IO (InterpState a, [Text]) Source #
Execute an arbitrary command, as if it was directly written in GHCi.
It is unlikely you want to call this directly, and instead want to call
one of the wrapped functions or execMuted
or execCleaned
.
execCleaned :: Monoid a => Text -> InterpState a -> ExceptT DaemonError IO (InterpState a, [Text]) Source #
exec
, but fully clean the message from prompt.
execMuted :: Monoid a => Text -> InterpState a -> ExceptT DaemonError IO (InterpState a) Source #
exec
, but throw out any messages.
Wrapped operations with the daemon
step :: Monoid a => InterpState a -> ExceptT DaemonError IO (InterpState a) Source #
Analogue to :step
.
:: Monoid a | |
=> Text | |
-> InterpState a | Function name to jump to. |
-> ExceptT DaemonError IO (InterpState a) | New interpreter state. |
Analogue to :step func
.
load :: Monoid a => FilePath -> InterpState a -> DaemonIO (InterpState a) Source #
Analogue to :load filepath
. Throws out any messages.
continue :: Monoid a => InterpState a -> DaemonIO (InterpState a) Source #
Analogue to :continue
. Throws out any messages.
Breakpoints
getBpInCurModule :: InterpState a -> [Int] Source #
Return a list of breakpoint line numbers in the currently paused file.
getBpInFile :: FilePath -> InterpState a -> [Int] Source #
Return a list of breakpoint line numbers in the given filepath.
toggleBreakpointLine :: Monoid a => BreakpointArg -> InterpState a -> DaemonIO (InterpState a) Source #
Toggle a breakpoint (disable/enable) at a given location.
setBreakpointLine :: Monoid a => BreakpointArg -> InterpState a -> DaemonIO (InterpState a) Source #
Set a breakpoint at a given line.
deleteBreakpointLine :: Monoid a => BreakpointArg -> InterpState a -> DaemonIO (InterpState a) Source #
Delete a breakpoint at a given line.
Tracing
trace :: Monoid a => InterpState a -> DaemonIO (InterpState a) Source #
Analogue to :trace
, with no arguments. Throws out any messages.
history :: InterpState a -> DaemonIO (InterpState a, Either Text [Text]) Source #
Tab completion
:: Monoid a | |
=> Text | Text (prefix) to return autocompletions of. Does not need to be escaped. |
-> InterpState a | Interpreter state to use. |
-> DaemonIO (InterpState a, (Text, [Text])) | Resulting state, the prefix, and autocompletions. |
Return tab completions for a given prefix.
Analog to :complete repl "prefix"
See https://downloads.haskell.org/ghc/latest/docs/users_guide/ghci.html#ghci-cmd-:complete
Misc
isExecuting :: InterpState a -> Bool Source #
Is the daemon currently in the middle of an expression evaluation?
data BreakpointArg Source #
Location info passed to breakpoint functions.
Instances
Show BreakpointArg Source # | |
Defined in Ghcitui.Ghcid.Daemon showsPrec :: Int -> BreakpointArg -> ShowS # show :: BreakpointArg -> String # showList :: [BreakpointArg] -> ShowS # | |
Eq BreakpointArg Source # | |
Defined in Ghcitui.Ghcid.Daemon (==) :: BreakpointArg -> BreakpointArg -> Bool # (/=) :: BreakpointArg -> BreakpointArg -> Bool # | |
Ord BreakpointArg Source # | |
Defined in Ghcitui.Ghcid.Daemon compare :: BreakpointArg -> BreakpointArg -> Ordering # (<) :: BreakpointArg -> BreakpointArg -> Bool # (<=) :: BreakpointArg -> BreakpointArg -> Bool # (>) :: BreakpointArg -> BreakpointArg -> Bool # (>=) :: BreakpointArg -> BreakpointArg -> Bool # max :: BreakpointArg -> BreakpointArg -> BreakpointArg # min :: BreakpointArg -> BreakpointArg -> BreakpointArg # |
type DaemonIO r = ExceptT DaemonError IO r Source #
An IO operation that can fail into a DaemonError.
Execute them to IO through run
.
data DaemonError Source #
Instances
Show DaemonError Source # | |
Defined in Ghcitui.Ghcid.Daemon showsPrec :: Int -> DaemonError -> ShowS # show :: DaemonError -> String # showList :: [DaemonError] -> ShowS # | |
Eq DaemonError Source # | |
Defined in Ghcitui.Ghcid.Daemon (==) :: DaemonError -> DaemonError -> Bool # (/=) :: DaemonError -> DaemonError -> Bool # |