W3cubDocs

/Haskell 9

GHCi.RemoteTypes

Safe Haskell None
Language Haskell2010

Description

Types for referring to remote objects in Remote GHCi. For more details, see Note [External GHCi pointers] in compilerGHCRuntime/Interpreter.hs

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

Remote pointer

newtype RemotePtr a Source

Constructors

RemotePtr Word64
Instances
Instances details
Binary (RemotePtr a) Source
Instance details

Defined in GHCi.RemoteTypes

Methods

put :: RemotePtr a -> Put Source

get :: Get (RemotePtr a) Source

putList :: [RemotePtr a] -> Put Source

NFData (RemotePtr a) Source
Instance details

Defined in GHCi.RemoteTypes

Methods

rnf :: RemotePtr a -> () Source

Show (RemotePtr a) Source
Instance details

Defined in GHCi.RemoteTypes

Methods

showsPrec :: Int -> RemotePtr a -> ShowS

show :: RemotePtr a -> String

showList :: [RemotePtr a] -> ShowS

toRemotePtr :: Ptr a -> RemotePtr a Source

fromRemotePtr :: RemotePtr a -> Ptr a Source

castRemotePtr :: RemotePtr a -> RemotePtr b Source

RemoteRef: reference to some heap object (potentially remote)

newtype RemoteRef a Source

A reference to a heap object. Potentially in a remote heap! These are allocated and freed explicitly.

Constructors

RemoteRef (RemotePtr ())
Instances
Instances details
Binary (RemoteRef a) Source
Instance details

Defined in GHCi.RemoteTypes

Methods

put :: RemoteRef a -> Put Source

get :: Get (RemoteRef a) Source

putList :: [RemoteRef a] -> Put Source

Show (RemoteRef a) Source
Instance details

Defined in GHCi.RemoteTypes

Methods

showsPrec :: Int -> RemoteRef a -> ShowS

show :: RemoteRef a -> String

showList :: [RemoteRef a] -> ShowS

mkRemoteRef :: a -> IO (RemoteRef a) Source

Make a reference to a local value that we can send remotely. This reference will keep the value that it refers to alive until freeRemoteRef is called.

localRef :: RemoteRef a -> IO a Source

Convert a RemoteRef to its carried type. Should only be used if the RemoteRef originated in this process.

freeRemoteRef :: RemoteRef a -> IO () Source

Release a RemoteRef that originated in this process

castRemoteRef :: RemoteRef a -> RemoteRef b Source

ForeignRef: RemoteRef with a finalizer

data ForeignRef a Source

An RemoteRef with a finalizer

Instances
Instances details
NFData (ForeignRef a) Source
Instance details

Defined in GHCi.RemoteTypes

Methods

rnf :: ForeignRef a -> () Source

mkForeignRef :: RemoteRef a -> IO () -> IO (ForeignRef a) Source

Create a ForeignRef from a RemoteRef. The finalizer should arrange to call freeRemoteRef on the RemoteRef. (since this function needs to be called in the process that created the RemoteRef, it cannot be called directly from the finalizer).

withForeignRef :: ForeignRef a -> (RemoteRef a -> IO b) -> IO b Source

Use a ForeignRef

finalizeForeignRef :: ForeignRef a -> IO () Source

castForeignRef :: ForeignRef a -> ForeignRef b Source

unsafeForeignRefToRemoteRef :: ForeignRef a -> RemoteRef a Source

HValue

newtype HValue Source

Constructors

HValue (Any :: Type)
Instances
Instances details
Show HValue Source
Instance details

Defined in GHCi.RemoteTypes

Methods

showsPrec :: Int -> HValue -> ShowS

show :: HValue -> String

showList :: [HValue] -> ShowS

type HValueRef = RemoteRef HValue Source

type ForeignHValue = ForeignRef HValue Source

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/ghci-9.12.1-fde5/GHCi-RemoteTypes.html