Files
docs
examples
conf
dynload
eval
hier
iface
load
loadCLib
make
makewith
global_pragma
io
merge00
mergeto0
module_name
Bar.hs
Foo.hs
Main.hs
Makefile
expected
multi_make
should_fail_0
tiny
unsafeio
misc
multi
objc
pdynload
pkgconf
plugs
reload
shell
unload
unloadAll
README
TIMINGS
build.mk
check.mk
eval.mk
foreign.mk
scripts
src
AUTHORS
LICENSE
Makefile
README
TODO
VERSION
config.guess
config.h.in
config.mk.in
config.sub
configure
configure.ac
install-sh
shaniqua-plugins/examples/makewith/module_name/Main.hs

34 lines
968 B
Haskell
Raw Normal View History

2005-04-24 08:51:33 +00:00
import System.Plugins
2005-04-24 08:51:33 +00:00
import System.Directory
a = "Foo.hs" -- uesr code
b = "Bar.hs" -- trusted code. Result is "Bar.o"
main = do
status <- makeWith a b []
s <- case status of
MakeFailure e -> mapM_ putStrLn e >> error "failed"
MakeSuccess n s -> print n >> return s
status <- makeWith a b []
s' <- case status of
MakeFailure e -> mapM_ putStrLn e >> error "failed"
MakeSuccess n s -> print n >> return s
status <- makeWith a b []
s'' <- case status of
MakeFailure e -> mapM_ putStrLn e >> error "failed"
MakeSuccess n s -> print n >> return s
print $ (s == s') && (s' == s'')
m_v <- load s [] [] "resource"
v <- case m_v of
LoadSuccess _ v -> return v
_ -> error "load failed"
putStrLn $ show $ (v :: Int)
makeCleaner s''