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"

View File

@ -0,0 +1,7 @@
TEST= hier/hier3
EXTRA_OBJS=One.o Two.o
EXTRAFLAGS=
TOP=../../..
include ../../eval.mk

View File

@ -0,0 +1,7 @@
module One where
import qualified Two
resource = "This is the sub-plugin of (" ++ Two.resource ++ ")"

View File

@ -0,0 +1,4 @@
module Two where
resource = "This is the top plugin"

View File

@ -0,0 +1,5 @@
Two plugin: This is the top plugin
Two plugin: This is the top plugin
Two plugin: This is the top plugin
Two plugin: This is the top plugin
One plugin: This is the sub-plugin of (This is the top plugin)