Skip to content

esoeylemez/foreign-store

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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