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,4 @@
module Bar where
resource :: Int
resource = 2

View File

@ -0,0 +1,4 @@
module Foo where
resource :: Integer
resource = 1

View File

@ -0,0 +1,37 @@
import System.Plugins
import System.Directory
a = "Foo.hs" -- user code
b = "Bar.hs" -- more user code
z = "Stub.hs" -- and a stub
main = do
status <- makeWith a z []
s <- case status of
MakeFailure e -> mapM_ putStrLn e >> error "failed"
MakeSuccess n s -> print n >> return s
status <- makeWith b z []
s' <- case status of
MakeFailure e -> mapM_ putStrLn e >> error "failed"
MakeSuccess n s -> print n >> return s
-- shouldn't need to remerge (a,z)
status <- makeWith a z []
t <- case status of
MakeFailure e -> mapM_ putStrLn e >> error "failed"
MakeSuccess n s -> print n >> return s
-- shouldn't need to remerge (b,z)
status <- makeWith b z []
t' <- case status of
MakeFailure e -> mapM_ putStrLn e >> error "failed"
MakeSuccess n s -> print n >> return s
print $ s /= s' -- test we got unique modules
print $ t /= t' -- test we got unique modules
mapM_ makeCleaner [s,s']

View File

@ -0,0 +1,4 @@
TEST=makewith/multi_make
TOP=../../..
include ../../eval.mk

View File

@ -0,0 +1,4 @@
module Stub where
resource :: Int

View File

@ -0,0 +1,6 @@
ReComp
ReComp
NotReq
NotReq
True
True