Safe Haskell | Safe-Inferred |
---|
Store a stable pointer in a foreign context to be retrieved later. Persists through GHCi reloads.
Documentation
newStore :: a -> IO (Store a)Source
Make a new store. The internal vector of stores grows in side. When stores are deleted the vector does not shrink, but old slots are re-used.
readStore :: Store a -> IO aSource
Read from the store. If the store has been deleted, this will throw an exception.
deleteStore :: Store a -> IO ()Source
Frees the stable pointer for GC and frees up the slot in the store. Deleting an already deleted store is a no-op.