Copyright | (C) 2014 I/O Tweag |
---|---|
License | see libraries/base/LICENSE |
Maintainer | cvs-ghc@haskell.org |
Stability | internal |
Portability | non-portable (GHC Extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Symbolic references to values.
References to values are usually implemented with memory addresses, and this is practical when communicating values between the different pieces of a single process.
When values are communicated across different processes running in possibly different machines, though, addresses are no longer useful since each process may use different addresses to store a given value.
To solve such concern, the references provided by this module offer a key that can be used to locate the values on each process. Each process maintains a global table of references which can be looked up with a given key. This table is known as the Static Pointer Table. The reference can then be dereferenced to obtain the value.
- data StaticPtr a
- deRefStaticPtr :: StaticPtr a -> a
- type StaticKey = Fingerprint
- staticKey :: StaticPtr a -> StaticKey
- unsafeLookupStaticPtr :: StaticKey -> IO (Maybe (StaticPtr a))
- data StaticPtrInfo = StaticPtrInfo {
- spInfoUnitId :: String
- spInfoModuleName :: String
- spInfoName :: String
- spInfoSrcLoc :: (Int, Int)
- staticPtrInfo :: StaticPtr a -> StaticPtrInfo
- staticPtrKeys :: IO [StaticKey]
- class IsStatic p where
Documentation
deRefStaticPtr :: StaticPtr a -> a #
Dereferences a static pointer.
type StaticKey = Fingerprint #
A key for StaticPtrs
that can be serialized and used with
unsafeLookupStaticPtr
.
data StaticPtrInfo #
Miscelaneous information available for debugging purposes.
StaticPtrInfo | |
|
staticPtrInfo :: StaticPtr a -> StaticPtrInfo #
StaticPtrInfo
of the given StaticPtr
.
staticPtrKeys :: IO [StaticKey] #
A list of all known keys.
A class for things buildable from static pointers.
fromStaticPtr :: StaticPtr a -> p a #