Files
docs
scripts
src
testsuite
conf
dynload
eval
hier
iface
load
loadCLib
make
makewith
misc
multi
objc
pdynload
pkgconf
plugs
reload
shell
unload
unloadAll
null
api
prog
Main.hs
expected
Dep.hs
Makefile
Null.hs
README
TIMINGS
build.mk
check.mk
eval.mk
foreign.mk
.gitignore
.travis.yml
AUTHORS
LICENSE
Makefile
README
Setup.lhs
TODO
config.guess
config.h.in
config.mk.in
config.sub
configure
configure.ac
install.sh
plugins.cabal
stack.yaml
shaniqua-plugins/testsuite/unloadAll/null/prog/Main.hs

16 lines
539 B
Haskell
Raw Normal View History

2005-05-19 03:23:30 +00:00
import System.Plugins
import API
-- an example where we just want to load an object and run it
main = do
m_v <- load_ "../Null.o" ["../api",".."] "resource"
t <- load_ "../Dep.o" ["../api"] "resource"
case m_v of
LoadFailure err -> error (unlines err)
LoadSuccess m v -> do putStrLn ( show (a v) ) ; unloadAll m -- unloads Null.o but not Dep.o since we're still using it.
2005-05-19 03:23:30 +00:00
case t of
LoadFailure err -> error (unlines err)
LoadSuccess m v -> do putStrLn ( show (a v) ) ; unloadAll m