GHCi.Message

ghc-lib-parser-9.10.1.20250103: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHCi.Message

Contents

- Orphan instances

Description

Remote GHCi message types and serialization.

For details on Remote GHCi, see Note [Remote GHCi] in compilerGHCRuntime/Interpreter.hs.

Synopsis

- data Message a where
  - Shutdown :: Message ()
  - RtsRevertCAFs :: Message ()
  - InitLinker :: Message ()
  - LookupSymbol :: String -> Message (Maybe (RemotePtr ()))
  - LookupClosure :: String -> Message (Maybe HValueRef)
  - LoadDLL :: String -> Message (Maybe String)
  - LoadArchive :: String -> Message ()
  - LoadObj :: String -> Message ()
  - UnloadObj :: String -> Message ()
  - AddLibrarySearchPath :: String -> Message (RemotePtr ())
  - RemoveLibrarySearchPath :: RemotePtr () -> Message Bool
  - ResolveObjs :: Message Bool
  - FindSystemLibrary :: String -> Message (Maybe String)
  - CreateBCOs :: [ResolvedBCO] -> Message [HValueRef]
  - FreeHValueRefs :: [HValueRef] -> Message ()
  - AddSptEntry :: Fingerprint -> HValueRef -> Message ()
  - MallocData :: ByteString -> Message (RemotePtr ())
  - MallocStrings :: [ByteString] -> Message [RemotePtr ()]
  - PrepFFI :: FFIConv -> [FFIType] -> FFIType -> Message (RemotePtr C_ffi_cif)
  - FreeFFI :: RemotePtr C_ffi_cif -> Message ()
  - MkConInfoTable :: Bool -> Int -> Int -> Int -> Int -> ByteString -> Message (RemotePtr StgInfoTable)
  - EvalStmt :: EvalOpts -> EvalExpr HValueRef -> Message (EvalStatus_ [HValueRef] [HValueRef])
  - ResumeStmt :: EvalOpts -> RemoteRef (ResumeContext [HValueRef]) -> Message (EvalStatus_ [HValueRef] [HValueRef])
  - AbandonStmt :: RemoteRef (ResumeContext [HValueRef]) -> Message ()
  - EvalString :: HValueRef -> Message (EvalResult String)
  - EvalStringToString :: HValueRef -> String -> Message (EvalResult String)
  - EvalIO :: HValueRef -> Message (EvalResult ())
  - MkCostCentres :: String -> [(String, String)] -> Message [RemotePtr CostCentre]
  - CostCentreStackInfo :: RemotePtr CostCentreStack -> Message [String]
  - NewBreakArray :: Int -> Message (RemoteRef BreakArray)
  - SetupBreakpoint :: RemoteRef BreakArray -> Int -> Int -> Message ()
  - BreakpointStatus :: RemoteRef BreakArray -> Int -> Message Bool
  - GetBreakpointVar :: HValueRef -> Int -> Message (Maybe HValueRef)
  - StartTH :: Message (RemoteRef (IORef QState))
  - RunTH :: RemoteRef (IORef QState) -> HValueRef -> THResultType -> Maybe Loc -> Message (QResult ByteString)
  - RunModFinalizers :: RemoteRef (IORef QState) -> [RemoteRef (Q ())] -> Message (QResult ())
  - GetClosure :: HValueRef -> Message (GenClosure HValueRef)
  - Seq :: HValueRef -> Message (EvalStatus_ () ())
  - ResumeSeq :: RemoteRef (ResumeContext ()) -> Message (EvalStatus_ () ())
  - NewBreakModule :: String -> Message (RemotePtr BreakModule)
- data Msg = (Binary a, Show a) => Msg (Message a)
- data THMessage a where
  - NewName :: String -> THMessage (THResult Name)
  - Report :: Bool -> String -> THMessage (THResult ())
  - LookupName :: Bool -> String -> THMessage (THResult (Maybe Name))
  - Reify :: Name -> THMessage (THResult Info)
  - ReifyFixity :: Name -> THMessage (THResult (Maybe Fixity))
  - ReifyType :: Name -> THMessage (THResult Type)
  - ReifyInstances :: Name -> [Type] -> THMessage (THResult [Dec])
  - ReifyRoles :: Name -> THMessage (THResult [Role])
  - ReifyAnnotations :: AnnLookup -> TypeRep -> THMessage (THResult [ByteString])
  - ReifyModule :: Module -> THMessage (THResult ModuleInfo)
  - ReifyConStrictness :: Name -> THMessage (THResult [DecidedStrictness])
  - GetPackageRoot :: THMessage (THResult FilePath)
  - AddDependentFile :: FilePath -> THMessage (THResult ())
  - AddTempFile :: String -> THMessage (THResult FilePath)
  - AddModFinalizer :: RemoteRef (Q ()) -> THMessage (THResult ())
  - AddCorePlugin :: String -> THMessage (THResult ())
  - AddTopDecls :: [Dec] -> THMessage (THResult ())
  - AddForeignFilePath :: ForeignSrcLang -> FilePath -> THMessage (THResult ())
  - IsExtEnabled :: Extension -> THMessage (THResult Bool)
  - ExtsEnabled :: THMessage (THResult [Extension])
  - PutDoc :: DocLoc -> String -> THMessage (THResult ())
  - GetDoc :: DocLoc -> THMessage (THResult (Maybe String))
  - StartRecover :: THMessage ()
  - EndRecover :: Bool -> THMessage ()
  - FailIfErrs :: THMessage (THResult ())
  - RunTHDone :: THMessage ()
- data THMsg = (Binary a, Show a) => THMsg (THMessage a)
- data QResult a
  - = QDone a
  - | QException String
  - | QFail String
- data EvalStatus_ a b
  - = EvalComplete Word64 (EvalResult a)
  - | EvalBreak HValueRef (Maybe EvalBreakpoint) (RemoteRef (ResumeContext b)) (RemotePtr CostCentreStack)
- type EvalStatus a = EvalStatus_ a a
- data EvalResult a
  - = EvalException SerializableException
  - | EvalSuccess a
- data EvalOpts = EvalOpts {
  - useSandboxThread :: Bool
  - singleStep :: Bool
  - breakOnException :: Bool
  - breakOnError :: Bool
  }
- data EvalExpr a
  - = EvalThis a
  - | EvalApp (EvalExpr a) (EvalExpr a)
- data EvalBreakpoint = EvalBreakpoint Int String
- data SerializableException
  - = EUserInterrupt
  - | EExitCode ExitCode
  - | EOtherException String
- toSerializableException :: SomeException -> SerializableException
- fromSerializableException :: SerializableException -> SomeException
- data THResult a
  - = THException String
  - | THComplete a
- data THResultType
  - = THExp
  - | THPat
  - | THType
  - | THDec
  - | THAnnWrapper
- data ResumeContext a = ResumeContext {
  - resumeBreakMVar :: MVar ()
  - resumeStatusMVar :: MVar (EvalStatus a)
  - resumeThreadId :: ThreadId
  }
- data QState = QState {
  - qsMap :: Map TypeRep Dynamic
  - qsLocation :: Maybe Loc
  - qsPipe :: Pipe
  }
- getMessage :: Get Msg
- putMessage :: Message a -> Put
- getTHMessage :: Get THMsg
- putTHMessage :: THMessage a -> Put
- data Pipe = Pipe {
  - pipeRead :: Handle
  - pipeWrite :: Handle
  - pipeLeftovers :: IORef (Maybe ByteString)
  }
- remoteCall :: Binary a => Pipe -> Message a -> IO a
- remoteTHCall :: Binary a => Pipe -> THMessage a -> IO a
- readPipe :: Pipe -> Get a -> IO a
- writePipe :: Pipe -> Put -> IO ()
- data BreakModule

# Documentation

data Message a where #

A `Message a` is a message that returns a value of type `a`. These are requests sent from GHC to the server.

Constructors

Shutdown :: Message () | Exit the iserv process
RtsRevertCAFs :: Message () |
InitLinker :: Message () |
LookupSymbol :: String -> Message (Maybe (RemotePtr ())) |
LookupClosure :: String -> Message (Maybe HValueRef) |
LoadDLL :: String -> Message (Maybe String) |
LoadArchive :: String -> Message () |
LoadObj :: String -> Message () |
UnloadObj :: String -> Message () |
AddLibrarySearchPath :: String -> Message (RemotePtr ()) |
RemoveLibrarySearchPath :: RemotePtr () -> Message Bool |
ResolveObjs :: Message Bool |
FindSystemLibrary :: String -> Message (Maybe String) |
CreateBCOs :: [ResolvedBCO] -> Message [HValueRef] | Create a set of BCO objects, and return HValueRefs to them See `createBCOs` in compilerGHCRuntime/Interpreter.hs. NB: this has a custom Binary behavior, see Note [Parallelize CreateBCOs serialization]
FreeHValueRefs :: [HValueRef] -> Message () | Release `HValueRef`s
AddSptEntry :: Fingerprint -> HValueRef -> Message () | Add entries to the Static Pointer Table
MallocData :: ByteString -> Message (RemotePtr ()) | Malloc some data and return a `RemotePtr` to it
MallocStrings :: [ByteString] -> Message [RemotePtr ()] |
PrepFFI :: FFIConv -> [FFIType] -> FFIType -> Message (RemotePtr C_ffi_cif) | Calls `prepareForeignCall`
FreeFFI :: RemotePtr C_ffi_cif -> Message () | Free data previously created by `PrepFFI`
MkConInfoTable :: Bool -> Int -> Int -> Int -> Int -> ByteString -> Message (RemotePtr StgInfoTable) | Create an info table for a constructor
EvalStmt :: EvalOpts -> EvalExpr HValueRef -> Message (EvalStatus_ [HValueRef] [HValueRef]) | Evaluate a statement
ResumeStmt :: EvalOpts -> RemoteRef (ResumeContext [HValueRef]) -> Message (EvalStatus_ [HValueRef] [HValueRef]) | Resume evaluation of a statement after a breakpoint
AbandonStmt :: RemoteRef (ResumeContext [HValueRef]) -> Message () | Abandon evaluation of a statement after a breakpoint
EvalString :: HValueRef -> Message (EvalResult String) | Evaluate something of type `IO String`
EvalStringToString :: HValueRef -> String -> Message (EvalResult String) | Evaluate something of type `String -> IO String`
EvalIO :: HValueRef -> Message (EvalResult ()) | Evaluate something of type `IO ()`
MkCostCentres :: String -> [(String, String)] -> Message [RemotePtr CostCentre] | Create a set of CostCentres with the same module name
CostCentreStackInfo :: RemotePtr CostCentreStack -> Message [String] | Show a `CostCentreStack` as a `[String]`
NewBreakArray :: Int -> Message (RemoteRef BreakArray) | Create a new array of breakpoint flags
SetupBreakpoint :: RemoteRef BreakArray -> Int -> Int -> Message () | Set how many times a breakpoint should be ignored also used for enable/disable
BreakpointStatus :: RemoteRef BreakArray -> Int -> Message Bool | Query the status of a breakpoint (True = enabled)
GetBreakpointVar :: HValueRef -> Int -> Message (Maybe HValueRef) | Get a reference to a free variable at a breakpoint
StartTH :: Message (RemoteRef (IORef QState)) | Start a new TH module, return a state token that should be
RunTH :: RemoteRef (IORef QState) -> HValueRef -> THResultType -> Maybe Loc -> Message (QResult ByteString) | Evaluate a TH computation. Returns a ByteString, because we have to force the result before returning it to ensure there are no errors lurking in it. The TH types don't have NFData instances, and even if they did, we have to serialize the value anyway, so we might as well serialize it to force it.
RunModFinalizers :: RemoteRef (IORef QState) -> [RemoteRef (Q ())] -> Message (QResult ()) | Run the given mod finalizers.
GetClosure :: HValueRef -> Message (GenClosure HValueRef) | Remote interface to GHC.Exts.Heap.getClosureData. This is used by the GHCi debugger to inspect values in the heap for :print and type reconstruction.
Seq :: HValueRef -> Message (EvalStatus_ () ()) | Evaluate something. This is used to support :force in GHCi.
ResumeSeq :: RemoteRef (ResumeContext ()) -> Message (EvalStatus_ () ()) | Resume forcing a free variable in a breakpoint (#2950)
NewBreakModule :: String -> Message (RemotePtr BreakModule) | Allocate a string for a breakpoint module name. This uses an empty dummy type because `ModuleName` isn't available here.

#### Instances

Instances details

Show (Message a) # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> Message a -> ShowS # show :: Message a -> String # showList :: [Message a] -> ShowS #

data Msg #

Constructors

(Binary a, Show a) => Msg (Message a) |

data THMessage a where #

Messages sent back to GHC from GHCi.TH, to implement the methods of `Quasi`. For an overview of how TH works with Remote GHCi, see Note [Remote Template Haskell] in GHCi.TH.

Constructors

NewName :: String -> THMessage (THResult Name) |
Report :: Bool -> String -> THMessage (THResult ()) |
LookupName :: Bool -> String -> THMessage (THResult (Maybe Name)) |
Reify :: Name -> THMessage (THResult Info) |
ReifyFixity :: Name -> THMessage (THResult (Maybe Fixity)) |
ReifyType :: Name -> THMessage (THResult Type) |
ReifyInstances :: Name -> [Type] -> THMessage (THResult [Dec]) |
ReifyRoles :: Name -> THMessage (THResult [Role]) |
ReifyAnnotations :: AnnLookup -> TypeRep -> THMessage (THResult [ByteString]) |
ReifyModule :: Module -> THMessage (THResult ModuleInfo) |
ReifyConStrictness :: Name -> THMessage (THResult [DecidedStrictness]) |
GetPackageRoot :: THMessage (THResult FilePath) |
AddDependentFile :: FilePath -> THMessage (THResult ()) |
AddTempFile :: String -> THMessage (THResult FilePath) |
AddModFinalizer :: RemoteRef (Q ()) -> THMessage (THResult ()) |
AddCorePlugin :: String -> THMessage (THResult ()) |
AddTopDecls :: [Dec] -> THMessage (THResult ()) |
AddForeignFilePath :: ForeignSrcLang -> FilePath -> THMessage (THResult ()) |
IsExtEnabled :: Extension -> THMessage (THResult Bool) |
ExtsEnabled :: THMessage (THResult [Extension]) |
PutDoc :: DocLoc -> String -> THMessage (THResult ()) |
GetDoc :: DocLoc -> THMessage (THResult (Maybe String)) |
StartRecover :: THMessage () |
EndRecover :: Bool -> THMessage () |
FailIfErrs :: THMessage (THResult ()) |
RunTHDone :: THMessage () | Indicates that this RunTH is finished, and the next message will be the result of RunTH (a QResult).

#### Instances

Instances details

Show (THMessage a) # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> THMessage a -> ShowS # show :: THMessage a -> String # showList :: [THMessage a] -> ShowS #

data THMsg #

Constructors

(Binary a, Show a) => THMsg (THMessage a) |

data QResult a #

Template Haskell return values

Constructors

QDone a | RunTH finished successfully; return value follows
QException String | RunTH threw an exception
QFail String | RunTH called `fail`

#### Instances

Instances details

Binary a => Binary (QResult a) # |
Instance details Defined in GHCi.Message Methods put :: QResult a -> Put # get :: Get (QResult a) # putList :: [QResult a] -> Put #
Generic (QResult a) # |
Instance details Defined in GHCi.Message Associated Types
type Rep (QResult a) |
Instance details Defined in GHCi.Message type Rep (QResult a) = D1 ('MetaData "QResult" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "QDone" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons "QException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "QFail" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))
Methods from :: QResult a -> Rep (QResult a) x # to :: Rep (QResult a) x -> QResult a #
Show a => Show (QResult a) # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> QResult a -> ShowS # show :: QResult a -> String # showList :: [QResult a] -> ShowS #
type Rep (QResult a) # |
Instance details Defined in GHCi.Message type Rep (QResult a) = D1 ('MetaData "QResult" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "QDone" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons "QException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "QFail" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

data EvalStatus_ a b #

Constructors

EvalComplete Word64 (EvalResult a) |
EvalBreak HValueRef (Maybe EvalBreakpoint) (RemoteRef (ResumeContext b)) (RemotePtr CostCentreStack) |

#### Instances

Instances details

Binary a => Binary (EvalStatus_ a b) # |
Instance details Defined in GHCi.Message Methods put :: EvalStatus_ a b -> Put # get :: Get (EvalStatus_ a b) # putList :: [EvalStatus_ a b] -> Put #
Generic (EvalStatus_ a b) # |
Instance details Defined in GHCi.Message Associated Types
type Rep (EvalStatus_ a b) |
Instance details Defined in GHCi.Message type Rep (EvalStatus_ a b) = D1 ('MetaData "EvalStatus_" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalComplete" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalResult a))) :+: C1 ('MetaCons "EvalBreak" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HValueRef) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe EvalBreakpoint))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RemoteRef (ResumeContext b))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RemotePtr CostCentreStack)))))
Methods from :: EvalStatus_ a b -> Rep (EvalStatus_ a b) x # to :: Rep (EvalStatus_ a b) x -> EvalStatus_ a b #
Show a => Show (EvalStatus_ a b) # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> EvalStatus_ a b -> ShowS # show :: EvalStatus_ a b -> String # showList :: [EvalStatus_ a b] -> ShowS #
type Rep (EvalStatus_ a b) # |
Instance details Defined in GHCi.Message type Rep (EvalStatus_ a b) = D1 ('MetaData "EvalStatus_" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalComplete" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalResult a))) :+: C1 ('MetaCons "EvalBreak" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HValueRef) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe EvalBreakpoint))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RemoteRef (ResumeContext b))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RemotePtr CostCentreStack)))))

type EvalStatus a = EvalStatus_ a a #

data EvalResult a #

Constructors

EvalException SerializableException |
EvalSuccess a |

#### Instances

Instances details

Binary a => Binary (EvalResult a) # |
Instance details Defined in GHCi.Message Methods put :: EvalResult a -> Put # get :: Get (EvalResult a) # putList :: [EvalResult a] -> Put #
Generic (EvalResult a) # |
Instance details Defined in GHCi.Message Associated Types
type Rep (EvalResult a) |
Instance details Defined in GHCi.Message type Rep (EvalResult a) = D1 ('MetaData "EvalResult" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SerializableException)) :+: C1 ('MetaCons "EvalSuccess" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
Methods from :: EvalResult a -> Rep (EvalResult a) x # to :: Rep (EvalResult a) x -> EvalResult a #
Show a => Show (EvalResult a) # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> EvalResult a -> ShowS # show :: EvalResult a -> String # showList :: [EvalResult a] -> ShowS #
type Rep (EvalResult a) # |
Instance details Defined in GHCi.Message type Rep (EvalResult a) = D1 ('MetaData "EvalResult" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SerializableException)) :+: C1 ('MetaCons "EvalSuccess" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

data EvalOpts #

Constructors

EvalOpts |
Fields useSandboxThread :: Bool singleStep :: Bool breakOnException :: Bool breakOnError :: Bool

#### Instances

Instances details

Binary EvalOpts # |
Instance details Defined in GHCi.Message Methods put :: EvalOpts -> Put # get :: Get EvalOpts # putList :: [EvalOpts] -> Put #
Generic EvalOpts # |
Instance details Defined in GHCi.Message Associated Types
type Rep EvalOpts |
Instance details Defined in GHCi.Message type Rep EvalOpts = D1 ('MetaData "EvalOpts" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalOpts" 'PrefixI 'True) ((S1 ('MetaSel ('Just "useSandboxThread") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "singleStep") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "breakOnException") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "breakOnError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))
Methods from :: EvalOpts -> Rep EvalOpts x # to :: Rep EvalOpts x -> EvalOpts #
Show EvalOpts # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> EvalOpts -> ShowS # show :: EvalOpts -> String # showList :: [EvalOpts] -> ShowS #
type Rep EvalOpts # |
Instance details Defined in GHCi.Message type Rep EvalOpts = D1 ('MetaData "EvalOpts" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalOpts" 'PrefixI 'True) ((S1 ('MetaSel ('Just "useSandboxThread") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "singleStep") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "breakOnException") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "breakOnError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))

data EvalExpr a #

We can pass simple expressions to EvalStmt, consisting of values and application. This allows us to wrap the statement to be executed in another function, which is used by GHCi to implement :set args and :set prog. It might be worthwhile to extend this little language in the future.

Constructors

EvalThis a |
EvalApp (EvalExpr a) (EvalExpr a) |

#### Instances

Instances details

Binary a => Binary (EvalExpr a) # |
Instance details Defined in GHCi.Message Methods put :: EvalExpr a -> Put # get :: Get (EvalExpr a) # putList :: [EvalExpr a] -> Put #
Generic (EvalExpr a) # |
Instance details Defined in GHCi.Message Associated Types
type Rep (EvalExpr a) |
Instance details Defined in GHCi.Message type Rep (EvalExpr a) = D1 ('MetaData "EvalExpr" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalThis" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "EvalApp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalExpr a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalExpr a))))
Methods from :: EvalExpr a -> Rep (EvalExpr a) x # to :: Rep (EvalExpr a) x -> EvalExpr a #
Show a => Show (EvalExpr a) # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> EvalExpr a -> ShowS # show :: EvalExpr a -> String # showList :: [EvalExpr a] -> ShowS #
type Rep (EvalExpr a) # |
Instance details Defined in GHCi.Message type Rep (EvalExpr a) = D1 ('MetaData "EvalExpr" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalThis" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "EvalApp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalExpr a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalExpr a))))

data EvalBreakpoint #

Constructors

EvalBreakpoint |
Fields Int break index String ModuleName

#### Instances

Instances details

Binary EvalBreakpoint # |
Instance details Defined in GHCi.Message Methods put :: EvalBreakpoint -> Put # get :: Get EvalBreakpoint # putList :: [EvalBreakpoint] -> Put #
Generic EvalBreakpoint # |
Instance details Defined in GHCi.Message Associated Types
type Rep EvalBreakpoint |
Instance details Defined in GHCi.Message type Rep EvalBreakpoint = D1 ('MetaData "EvalBreakpoint" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalBreakpoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))
Methods from :: EvalBreakpoint -> Rep EvalBreakpoint x # to :: Rep EvalBreakpoint x -> EvalBreakpoint #
Show EvalBreakpoint # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> EvalBreakpoint -> ShowS # show :: EvalBreakpoint -> String # showList :: [EvalBreakpoint] -> ShowS #
type Rep EvalBreakpoint # |
Instance details Defined in GHCi.Message type Rep EvalBreakpoint = D1 ('MetaData "EvalBreakpoint" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EvalBreakpoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

data SerializableException #

Constructors

EUserInterrupt |
EExitCode ExitCode |
EOtherException String |

#### Instances

Instances details

Binary SerializableException # |
Instance details Defined in GHCi.Message Methods put :: SerializableException -> Put # get :: Get SerializableException # putList :: [SerializableException] -> Put #
Generic SerializableException # |
Instance details Defined in GHCi.Message Associated Types
type Rep SerializableException |
Instance details Defined in GHCi.Message type Rep SerializableException = D1 ('MetaData "SerializableException" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EUserInterrupt" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EExitCode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExitCode)) :+: C1 ('MetaCons "EOtherException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))
Methods from :: SerializableException -> Rep SerializableException x # to :: Rep SerializableException x -> SerializableException #
Show SerializableException # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> SerializableException -> ShowS # show :: SerializableException -> String # showList :: [SerializableException] -> ShowS #
type Rep SerializableException # |
Instance details Defined in GHCi.Message type Rep SerializableException = D1 ('MetaData "SerializableException" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "EUserInterrupt" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EExitCode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExitCode)) :+: C1 ('MetaCons "EOtherException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

toSerializableException :: SomeException -> SerializableException #

fromSerializableException :: SerializableException -> SomeException #

data THResult a #

Constructors

THException String |
THComplete a |

#### Instances

Instances details

Binary a => Binary (THResult a) # |
Instance details Defined in GHCi.Message Methods put :: THResult a -> Put # get :: Get (THResult a) # putList :: [THResult a] -> Put #
Generic (THResult a) # |
Instance details Defined in GHCi.Message Associated Types
type Rep (THResult a) |
Instance details Defined in GHCi.Message type Rep (THResult a) = D1 ('MetaData "THResult" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "THException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "THComplete" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
Methods from :: THResult a -> Rep (THResult a) x # to :: Rep (THResult a) x -> THResult a #
Show a => Show (THResult a) # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> THResult a -> ShowS # show :: THResult a -> String # showList :: [THResult a] -> ShowS #
type Rep (THResult a) # |
Instance details Defined in GHCi.Message type Rep (THResult a) = D1 ('MetaData "THResult" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) (C1 ('MetaCons "THException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "THComplete" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

data THResultType #

Constructors

THExp |
THPat |
THType |
THDec |
THAnnWrapper |

#### Instances

Instances details

Binary THResultType # |
Instance details Defined in GHCi.Message Methods put :: THResultType -> Put # get :: Get THResultType # putList :: [THResultType] -> Put #
Enum THResultType # |
Instance details Defined in GHCi.Message Methods succ :: THResultType -> THResultType # pred :: THResultType -> THResultType # toEnum :: Int -> THResultType # fromEnum :: THResultType -> Int # enumFrom :: THResultType -> [THResultType] # enumFromThen :: THResultType -> THResultType -> [THResultType] # enumFromTo :: THResultType -> THResultType -> [THResultType] # enumFromThenTo :: THResultType -> THResultType -> THResultType -> [THResultType] #
Generic THResultType # |
Instance details Defined in GHCi.Message Associated Types
type Rep THResultType |
Instance details Defined in GHCi.Message type Rep THResultType = D1 ('MetaData "THResultType" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) ((C1 ('MetaCons "THExp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "THPat" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "THType" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "THDec" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "THAnnWrapper" 'PrefixI 'False) (U1 :: Type -> Type))))
Methods from :: THResultType -> Rep THResultType x # to :: Rep THResultType x -> THResultType #
Show THResultType # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> THResultType -> ShowS # show :: THResultType -> String # showList :: [THResultType] -> ShowS #
type Rep THResultType # |
Instance details Defined in GHCi.Message type Rep THResultType = D1 ('MetaData "THResultType" "GHCi.Message" "ghc-lib-parser-9.10.1.20250103-FaHJOkjTl0Y9STmjhYbIHo" 'False) ((C1 ('MetaCons "THExp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "THPat" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "THType" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "THDec" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "THAnnWrapper" 'PrefixI 'False) (U1 :: Type -> Type))))

data ResumeContext a #

Constructors

ResumeContext |
Fields resumeBreakMVar :: MVar () resumeStatusMVar :: MVar (EvalStatus a) resumeThreadId :: ThreadId

data QState #

The server-side Template Haskell state. This is created by the StartTH message. A new one is created per module that GHC typechecks.

Constructors

QState |
Fields qsMap :: Map TypeRep Dynamic persistent data between splices in a module qsLocation :: Maybe Loc location for current splice, if any qsPipe :: Pipe pipe to communicate with GHC

#### Instances

Instances details

Show QState # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> QState -> ShowS # show :: QState -> String # showList :: [QState] -> ShowS #

getMessage :: Get Msg #

putMessage :: Message a -> Put #

getTHMessage :: Get THMsg #

putTHMessage :: THMessage a -> Put #

data Pipe #

Constructors

Pipe |
Fields pipeRead :: Handle pipeWrite :: Handle pipeLeftovers :: IORef (Maybe ByteString)

remoteCall :: Binary a => Pipe -> Message a -> IO a #

remoteTHCall :: Binary a => Pipe -> THMessage a -> IO a #

readPipe :: Pipe -> Get a -> IO a #

writePipe :: Pipe -> Put -> IO () #

data BreakModule #

A dummy type that tags the pointer to a breakpoint's `ModuleName`, because that type isn't available here.

# Orphan instances

Binary ClosureType # |
Instance details Methods put :: ClosureType -> Put # get :: Get ClosureType # putList :: [ClosureType] -> Put #
Binary ExitCode # |
Instance details Methods put :: ExitCode -> Put # get :: Get ExitCode # putList :: [ExitCode] -> Put #
Binary PrimType # |
Instance details Methods put :: PrimType -> Put # get :: Get PrimType # putList :: [PrimType] -> Put #
Binary TsoFlags # |
Instance details Methods put :: TsoFlags -> Put # get :: Get TsoFlags # putList :: [TsoFlags] -> Put #
Binary WhatNext # |
Instance details Methods put :: WhatNext -> Put # get :: Get WhatNext # putList :: [WhatNext] -> Put #
Binary WhyBlocked # |
Instance details Methods put :: WhyBlocked -> Put # get :: Get WhyBlocked # putList :: [WhyBlocked] -> Put #
Binary StgInfoTable # |
Instance details Methods put :: StgInfoTable -> Put # get :: Get StgInfoTable # putList :: [StgInfoTable] -> Put #
Binary CostCentre # |
Instance details Methods put :: CostCentre -> Put # get :: Get CostCentre # putList :: [CostCentre] -> Put #
Binary CostCentreStack # |
Instance details Methods put :: CostCentreStack -> Put # get :: Get CostCentreStack # putList :: [CostCentreStack] -> Put #
Binary IndexTable # |
Instance details Methods put :: IndexTable -> Put # get :: Get IndexTable # putList :: [IndexTable] -> Put #
Binary StgTSOProfInfo # |
Instance details Methods put :: StgTSOProfInfo -> Put # get :: Get StgTSOProfInfo # putList :: [StgTSOProfInfo] -> Put #
Binary (FunPtr a) # |
Instance details Methods put :: FunPtr a -> Put # get :: Get (FunPtr a) # putList :: [FunPtr a] -> Put #
Binary (Ptr a) # |
Instance details Methods put :: Ptr a -> Put # get :: Get (Ptr a) # putList :: [Ptr a] -> Put #
Binary a => Binary (GenClosure a) # |
Instance details Methods put :: GenClosure a -> Put # get :: Get (GenClosure a) # putList :: [GenClosure a] -> Put #