Skip to content

Store a stable pointer in a foreign context to be retrieved later. Persists through GHCi reloads.

License

Notifications You must be signed in to change notification settings

esoeylemez/foreign-store

Repository files navigation

foreign-store Hackage

Store a stable pointer in a foreign context to be retrieved later. Persists through GHCi reloads.

Example:

$ cabal repl
> store <- newStore ((*2) :: Int -> Int)
> store
Store 0
> :l Foreign.Store
Ok, modules loaded: Foreign.Store.
> store
<interactive>:5:1: Not in scope: `store'
> Just store <- lookupStore 0 :: IO (Maybe (Store (Int -> Int)))
> f <- readStore store
> print (f 6)
12
>

About

Store a stable pointer in a foreign context to be retrieved later. Persists through GHCi reloads.

Resources

License

Stars

Watchers

Forks

Packages

No packages published