| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
GHC.Debugger.Runtime.Eval.RemoteExpr
Description
A DSL for evaluating remote expressions on the (possibly) remote debuggee process
Meant to be imported qualified as Remote for use with QualifiedDo.
import GHC.Debugger.Runtime.Eval.RemoteExpr (RemoteExpr) import qualified GHC.Debugger.Runtime.Eval.RemoteExpr as Remote
Synopsis
- data RemoteExpr (t :: TYPE ('BoxedRep l))
- var :: ModuleName -> String -> [String] -> RemoteExpr a
- ref :: ForeignRef a -> RemoteExpr a
- untypedRef :: forall {l :: Levity} (a :: TYPE ('BoxedRep l)). ForeignHValue -> RemoteExpr a
- lit :: Int -> RemoteExpr Int
- raw :: String -> RemoteExpr a
- app :: forall {l :: Levity} (a :: TYPE ('BoxedRep l)) b. RemoteExpr (a -> b) -> RemoteExpr a -> RemoteExpr b
- appRef :: RemoteExpr (a -> b) -> ForeignRef a -> RemoteExpr b
- withUnboxed :: RemoteExpr Int -> RemoteExpr (Int# -> b) -> RemoteExpr b
- fmap :: (RemoteExpr a -> RemoteExpr b) -> RemoteExpr (IO a) -> RemoteExpr (IO b)
- (<$>) :: (RemoteExpr a -> RemoteExpr b) -> RemoteExpr (IO a) -> RemoteExpr (IO b)
- pure :: RemoteExpr a -> RemoteExpr (IO a)
- return :: RemoteExpr a -> RemoteExpr (IO a)
- (>>=) :: RemoteExpr (IO a) -> (RemoteExpr a -> RemoteExpr (IO b)) -> RemoteExpr (IO b)
- (>>) :: RemoteExpr (IO a) -> RemoteExpr (IO b) -> RemoteExpr (IO b)
- eval :: RemoteExpr a -> Debugger (Either BadEvalStatus (ForeignRef a))
- evalIO :: RemoteExpr (IO a) -> Debugger (Either BadEvalStatus (ForeignRef a))
- evalString :: RemoteExpr String -> Debugger (Either BadEvalStatus String)
- evalIOList :: RemoteExpr (IO [a]) -> Debugger (Either BadEvalStatus [ForeignRef a])
- evalIOString :: RemoteExpr (IO String) -> Debugger (Either BadEvalStatus String)
Building remote expressions
data RemoteExpr (t :: TYPE ('BoxedRep l)) Source #
A remote expression to be evaluated on the debuggee process. Note: the remote expression must have a boxed representation type.
Instances
| Show (RemoteExpr a) Source # | |
Defined in GHC.Debugger.Runtime.Eval.RemoteExpr Methods showsPrec :: Int -> RemoteExpr a -> ShowS # show :: RemoteExpr a -> String # showList :: [RemoteExpr a] -> ShowS # | |
var :: ModuleName -> String -> [String] -> RemoteExpr a Source #
Apply a remote function to a remote argument to get a remote result
ref :: ForeignRef a -> RemoteExpr a Source #
A reference to a value in the debuggee heap
untypedRef :: forall {l :: Levity} (a :: TYPE ('BoxedRep l)). ForeignHValue -> RemoteExpr a Source #
A reference to a value in the debuggee heap
raw :: String -> RemoteExpr a Source #
A raw expression string to be parsed, compiled, and loaded onto the remote process
app :: forall {l :: Levity} (a :: TYPE ('BoxedRep l)) b. RemoteExpr (a -> b) -> RemoteExpr a -> RemoteExpr b Source #
Apply a remote function to a remote argument to get a remote result
appRef :: RemoteExpr (a -> b) -> ForeignRef a -> RemoteExpr b Source #
Apply a remote function to a remote ForeignRef to get a remote result
withUnboxed :: RemoteExpr Int -> RemoteExpr (Int# -> b) -> RemoteExpr b Source #
Apply a remote function after unboxing a remote int argument (We need to unbox the Int on the debuggee side)
fmap :: (RemoteExpr a -> RemoteExpr b) -> RemoteExpr (IO a) -> RemoteExpr (IO b) Source #
IO fmap on the remote process
(<$>) :: (RemoteExpr a -> RemoteExpr b) -> RemoteExpr (IO a) -> RemoteExpr (IO b) Source #
IO fmap on the remote process
pure :: RemoteExpr a -> RemoteExpr (IO a) Source #
IO pure on the remote process
return :: RemoteExpr a -> RemoteExpr (IO a) Source #
IO return on the remote process
(>>=) :: RemoteExpr (IO a) -> (RemoteExpr a -> RemoteExpr (IO b)) -> RemoteExpr (IO b) Source #
IO monadic bind on the remote process
(>>) :: RemoteExpr (IO a) -> RemoteExpr (IO b) -> RemoteExpr (IO b) Source #
IO monadic bind on the remote process
Evaluating remote expressions
eval :: RemoteExpr a -> Debugger (Either BadEvalStatus (ForeignRef a)) Source #
Evaluate a a expression on the remote process and return the foreign
reference to the result.
evalIO :: RemoteExpr (IO a) -> Debugger (Either BadEvalStatus (ForeignRef a)) Source #
Run an IO a computation in the remote process and return the foreign
reference to the returned a
evalString :: RemoteExpr String -> Debugger (Either BadEvalStatus String) Source #
Evaluate a string expression on the remote process and return the string to the debugger
evalIOList :: RemoteExpr (IO [a]) -> Debugger (Either BadEvalStatus [ForeignRef a]) Source #
Evaluate a RemoteExpr for a remote IO [a] and return a list of
ForeignHValue with one element per returned a.
Example
evalIOString :: RemoteExpr (IO String) -> Debugger (Either BadEvalStatus String) Source #
Execute an IO String on the remote process and serialize the string back to the debugger.