Update examples

This commit is contained in:
Don Stewart
2005-09-03 04:45:14 +00:00
parent 5321754614
commit dff0363224
421 changed files with 19 additions and 9 deletions

View File

@ -0,0 +1,25 @@
module Main where
import System.Plugins
main = do
makeAll "One.hs" []
load2 "Two.o"
load2 "./Two.o" -- shouldn't load
load2 "../hier3/Two.o" -- shouldn't load
load2 "././././Two.o" -- shouldn't load
-- and this one pulls in "../hier3/Two.o" as a dep
y <- load "One.o" ["../hier3"] [] "resource"
case y of
LoadSuccess _ s -> putStrLn $ "One plugin: " ++ s
LoadFailure _ -> putStrLn "Failure: y"
load2 f = do
x <- load f [".", "../hier3", ""] [] "resource" -- depend on One.o
case x of
LoadSuccess _ s -> putStrLn $ "Two plugin: " ++ s
LoadFailure _ -> putStrLn "Failure: x"