W3cubDocs

/Haskell 8

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 compilerghciGHCi.hs

For details on Remote GHCi, see Note [Remote GHCi] in compilerghciGHCi.hs.

newtype RemotePtr a Source

Constructors

RemotePtr Word64
Instances
Instances details
Show (RemotePtr a)
Instance details

Defined in GHCi.RemoteTypes

Binary (RemotePtr a)
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)
Instance details

Defined in GHCi.RemoteTypes

Methods

rnf :: RemotePtr a -> () Source

toRemotePtr :: Ptr a -> RemotePtr a Source

fromRemotePtr :: RemotePtr a -> Ptr a Source

castRemotePtr :: RemotePtr a -> RemotePtr b Source

newtype HValue Source

Constructors

HValue Any
Instances
Instances details
Show HValue
Instance details

Defined in GHCi.RemoteTypes

data RemoteRef a Source

A reference to a remote value. These are allocated and freed explicitly.

Instances
Instances details
Show (RemoteRef a)
Instance details

Defined in GHCi.RemoteTypes

Binary (RemoteRef a)
Instance details

Defined in GHCi.RemoteTypes

Methods

put :: RemoteRef a -> Put Source

get :: Get (RemoteRef a) Source

putList :: [RemoteRef a] -> Put Source

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 an HValueRef to an HValue. Should only be used if the HValue originated in this process.

freeRemoteRef :: RemoteRef a -> IO () Source

Release an HValueRef that originated in this process

type HValueRef = RemoteRef HValue Source

toHValueRef :: RemoteRef a -> RemoteRef HValue Source

data ForeignRef a Source

An HValueRef with a finalizer

Instances
Instances details
NFData (ForeignRef a)
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 freeHValueRef on the HValueRef. (since this function needs to be called in the process that created the HValueRef, it cannot be called directly from the finalizer).

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

Use a ForeignHValue

type ForeignHValue = ForeignRef HValue Source

unsafeForeignRefToRemoteRef :: ForeignRef a -> RemoteRef a Source

finalizeForeignRef :: ForeignRef a -> IO () Source

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