ghci-8.0.0.20160204: The library supporting GHC's interactive interpreter

Safe HaskellNone
LanguageHaskell2010

GHCi.Message

Contents

Synopsis

Documentation

data Message a where Source

A Message a is a message that returns a value of type a

Constructors

Shutdown :: Message ()

Exit the iserv process

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 :: [ByteString] -> Message [HValueRef]

Create a set of BCO objects, and return HValueRefs to them

FreeHValueRefs :: [HValueRef] -> Message ()

Release HValueRefs

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 :: Int -> Int -> Int -> [Word8] -> Message (RemotePtr StgInfoTable)

Create an info table for a constructor

EvalStmt :: EvalOpts -> EvalExpr HValueRef -> Message (EvalStatus [HValueRef])

Evaluate a statement

ResumeStmt :: EvalOpts -> RemoteRef (ResumeContext [HValueRef]) -> Message (EvalStatus [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

EnableBreakpoint :: RemoteRef BreakArray -> Int -> Bool -> Message ()

Enable a breakpoint

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

FinishTH :: RemoteRef (IORef QState) -> Message ()

Run TH module finalizers, and free the HValueRef

RunTH :: RemoteRef (IORef QState) -> HValueRef -> THResultType -> Maybe Loc -> Message 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.

NewName :: String -> Message (THResult Name) 
Report :: Bool -> String -> Message (THResult ()) 
LookupName :: Bool -> String -> Message (THResult (Maybe Name)) 
Reify :: Name -> Message (THResult Info) 
ReifyFixity :: Name -> Message (THResult (Maybe Fixity)) 
ReifyInstances :: Name -> [Type] -> Message (THResult [Dec]) 
ReifyRoles :: Name -> Message (THResult [Role]) 
ReifyAnnotations :: AnnLookup -> TypeRep -> Message (THResult [ByteString]) 
ReifyModule :: Module -> Message (THResult ModuleInfo) 
ReifyConStrictness :: Name -> Message (THResult [DecidedStrictness]) 
AddDependentFile :: FilePath -> Message (THResult ()) 
AddTopDecls :: [Dec] -> Message (THResult ()) 
IsExtEnabled :: Extension -> Message (THResult Bool) 
ExtsEnabled :: Message (THResult [Extension]) 
StartRecover :: Message () 
EndRecover :: Bool -> Message () 
QDone :: Message ()

RunTH finished successfully; return value follows

QException :: String -> Message ()

RunTH threw an exception

QFail :: String -> Message ()

RunTH called fail

Instances

data Msg Source

Constructors

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

data EvalStatus_ a b Source

Instances

Show a => Show (EvalStatus_ a b) 
Generic (EvalStatus_ a b) 

Associated Types

type Rep (EvalStatus_ a b) :: * -> * Source

Methods

from :: EvalStatus_ a b -> Rep (EvalStatus_ a b) x Source

to :: Rep (EvalStatus_ a b) x -> EvalStatus_ a b Source

Binary a => Binary (EvalStatus_ a b) 

Methods

put :: EvalStatus_ a b -> Put Source

get :: Get (EvalStatus_ a b) Source

type Rep (EvalStatus_ a b) = D1 (MetaData "EvalStatus_" "GHCi.Message" "ghci-8.0.0.20160204" False) ((:+:) (C1 (MetaCons "EvalComplete" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word64)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (EvalResult a))))) (C1 (MetaCons "EvalBreak" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 HValueRef)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (RemoteRef (ResumeContext b)))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (RemotePtr CostCentreStack)))))))) 

data EvalExpr a Source

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) 

data THResult a Source

Constructors

THException String 
THComplete a 

Instances

Show a => Show (THResult a) 
Generic (THResult a) 

Associated Types

type Rep (THResult a) :: * -> * Source

Methods

from :: THResult a -> Rep (THResult a) x Source

to :: Rep (THResult a) x -> THResult a Source

Binary a => Binary (THResult a) 

Methods

put :: THResult a -> Put Source

get :: Get (THResult a) Source

type Rep (THResult a) = D1 (MetaData "THResult" "GHCi.Message" "ghci-8.0.0.20160204" False) ((:+:) (C1 (MetaCons "THException" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))) (C1 (MetaCons "THComplete" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))) 

data QState Source

Constructors

QState 

Fields

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

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

Orphan instances