Update examples to use new module names

This commit is contained in:
Don Stewart 2005-05-15 06:03:55 +00:00
parent cfae954a22
commit 63717dc07c
94 changed files with 97 additions and 109 deletions

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
conf = "../Mailrc.conf"

View File

@ -7,7 +7,7 @@
module TestIO ( resource_dyn ) where
import API
import AltData
import AltData.Dynamic
import System.IO
import System.Posix.Types ( ProcessID, Fd )

View File

@ -2,7 +2,7 @@
module API where
import AltData
import AltData.Typeable
data TestIO = TestIO {
field :: IO String

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
main = do

View File

@ -1,7 +1,7 @@
module Plugin where
import API
import AltData
import AltData.Dynamic
my_fun = plugin {
equals = \x y -> (x /= y) -- a strange equals function :)

View File

@ -2,7 +2,7 @@
module API where
import AltData
import AltData.Typeable
data Interface = Interface {
equals :: forall t. Eq t => t -> t -> Bool

View File

@ -2,7 +2,7 @@
#include "../../../../config.h"
import Plugins
import System.Plugins
import API
main = do

View File

@ -2,7 +2,7 @@
module Plugin where
import API
import AltData
import AltData.Dynamic
v :: Int
v = 0xdeadbeef

View File

@ -2,7 +2,7 @@
module API where
import AltData
import AltData.Typeable
data Interface = Interface {
function :: String

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
main = do

View File

@ -5,7 +5,7 @@
module Plugin where
import API
import AltData
import AltData.Dynamic
v :: Int -> Int
v = \x -> 0xdeadbeef

View File

@ -2,7 +2,7 @@
module API where
import AltData
import AltData.Typeable
data Interface = Interface {
function :: String

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
main = do

View File

@ -9,7 +9,7 @@
module Plugin where
import API
import AltData
import AltData.Typeable
import GHC.Base
v :: Int

View File

@ -3,7 +3,7 @@
module Plugin ( resource_dyn ) where
import API
import AltData
import AltData.Dynamic
resource = plugin

View File

@ -2,7 +2,7 @@
module API where
import AltData
import AltData.Typeable
import GHC.Base
data Interface = Interface {

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
conf = "../Plugin.in"

View File

@ -1,5 +1,5 @@
../Plugin.in:18:15:
../Plugin.in:13:15:
Couldn't match `Dynamic' against `(a, b)'
Expected type: Dynamic
Inferred type: (a, b)

View File

@ -9,7 +9,7 @@ module Plugin where
import API
import AltData
import AltData.Typeable
import GHC.Base
v :: Int

View File

@ -2,7 +2,7 @@
module API where
import AltData
import AltData.Typeable
import GHC.Base
data Interface = Interface {

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
conf = "../Plugin.in"

View File

@ -1,5 +1,5 @@
../Plugin.in:18:15:
../Plugin.in:12:15:
Couldn't match `Dynamic' against `(a, b)'
Expected type: Dynamic
Inferred type: (a, b)

View File

@ -2,7 +2,7 @@
module Plugin where
import API
import AltData
import AltData.Dynamic
my_fun = plugin { function = "plugin says \"hello\"" }

View File

@ -2,7 +2,7 @@
module API where
import AltData
import AltData.Typeable
data Interface = Interface {
function :: String

View File

@ -2,7 +2,7 @@
#include "../../../../config.h"
import Plugins
import System.Plugins
import API
main = do

View File

@ -1,7 +1,7 @@
include $(TOP)/config.mk
include $(TOP)/examples/check.mk
PKGFLAGS= -package-conf $(TOP)/plugins.conf.inplace -package eval -package plugins -package printf
PKGFLAGS= -package-conf $(TOP)/plugins.conf.inplace -package plugins
BIN=a.out
SRC=Main.hs
@ -24,4 +24,4 @@ $(BIN): $(SRC) $(OBJS)
@$(GHC) $(INCLUDES) $(PKGFLAGS) $(GHCFLAGS) $(EXTRAFLAGS) -c $<
clean:
rm -rf *.hi *.o *~ $(BIN)
@rm -rf *.hi *.o *~ $(BIN)

View File

@ -1,5 +1,5 @@
import Eval.Haskell
import System.Eval.Haskell
main = do i <- eval "1 + 6 :: Int" [] :: IO (Maybe Int)
if isJust i then putStrLn $ show (fromJust i) else return ()

View File

@ -1,4 +1,4 @@
import Eval.Haskell
import System.Eval.Haskell
main = do m_s <- eval "map toUpper \"haskell\"" ["Data.Char"]
case m_s of

View File

@ -10,7 +10,7 @@
#include "../../../config.h"
import Eval.Haskell
import System.Eval.Haskell
import AltData.Dynamic
-- import Data.Dynamic

View File

@ -1,5 +1,5 @@
import Eval.Haskell
import System.Eval.Haskell
main = do i <- eval_ "Just (7 :: Int)"
["Maybe"]

View File

@ -4,7 +4,7 @@
--
-- needs unsafeEval because eval has a broken Dynamic check
--
import Eval.Haskell
import System.Eval.Haskell
main = do fn <- unsafeEval "(\\x -> (x,x::Int))" [] :: IO (Maybe (Int -> (Int,Int)))
when (isJust fn) $ putStrLn $ show $ (fromJust fn) 7

View File

@ -6,7 +6,7 @@
module Main where
import Poly
import Eval.Haskell
import System.Eval.Haskell
main = do m_f <- eval "Fn (\\x y -> x == y)" ["Poly"]
when (isJust m_f) $ do

View File

@ -1,6 +1,6 @@
import Plugins.Make
import Eval.Haskell
import System.Plugins.Make
import System.Eval.Haskell
main = do make "a/Extra.hs" []

View File

@ -3,7 +3,7 @@ include $(TOP)/examples/check.mk
INCLUDES= -I$(TOP)
PKGFLAGS= -package-conf $(TOP)/plugins.conf.inplace -package eval
PKGFLAGS= -package-conf $(TOP)/plugins.conf.inplace -package plugins
# compile with GHC to save us setting all the necessary include and
# lib flags. use ghc -v to find out what these are if you wish to go

View File

@ -5,7 +5,7 @@
module Main where
import Plugins
import System.Plugins
import API
import Modules.Flags as Flags

View File

@ -6,7 +6,7 @@
module Main where
import Plugins
import System.Plugins
main = do
status <- load "../A/B/C/Module.o" [".."] [] "symbol"

View File

@ -1,6 +1,6 @@
module Main where
import Plugins
import System.Plugins
main = do

View File

@ -1,6 +1,6 @@
module Main where
import Plugins
import System.Plugins
main = do

View File

@ -1,6 +1,6 @@
module Main ( main ) where
import Hi.Parser
import Language.Hi.Parser
import A
import B

View File

@ -2,7 +2,7 @@
#include "../../../../config.h"
import Plugins
import System.Plugins
import API
main :: IO ()

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
main = do

View File

@ -1,4 +1,4 @@
import Plugins
import System.Plugins
main = loadPackageWith "posix" []

View File

@ -2,7 +2,7 @@
#include "../../../../config.h"
import Plugins
import System.Plugins
import API
-- an example where we just want to load an object and run it

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
main = do

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
import A

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
main = do loadPackage "posix"
unloadPackage "posix"

View File

@ -2,7 +2,7 @@
-- little more complex. use the path to the obj file we get back from
-- 'make'. load() uses this to find the .hi file
import Plugins
import System.Plugins
import API
main = do

View File

@ -1,7 +1,7 @@
-- an example where we want to compile and load a file
import Plugins
import System.Plugins
import API
main = do

View File

@ -1,4 +1,4 @@
import Plugins
import System.Plugins
import API
import System.Directory

View File

@ -1,4 +1,4 @@
import Plugins
import System.Plugins
import API
import System.Directory

View File

@ -7,7 +7,7 @@
-- False
--
import Plugins
import System.Plugins
import System.Directory
main = do

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import System.Directory

View File

@ -2,7 +2,7 @@
-- little more complex. use the path to the obj file we get back from
-- 'make'. load() uses this to find the .hi file
import Plugins
import System.Plugins
import API
main = do

View File

@ -2,8 +2,8 @@
module M ( resource ) where
import System.IO.Unsafe
import API
import System.IO.Unsafe
import System.Process
import System.IO

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
conf = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
conf = "../TestIO.conf"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import System.Directory

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import System.Directory

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import System.Directory

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import System.Directory

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
conf = "../Plugin.in"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
import Data.Either

View File

@ -1,4 +1,4 @@
import Plugins
import System.Plugins
import API
import Data.Either

View File

@ -1,5 +1,5 @@
import Plugins.MkTemp
import System.MkTemp
import Data.Maybe

View File

@ -1,4 +1,4 @@
import Plugins
import System.Plugins
import API
main = do

View File

@ -2,9 +2,9 @@
module PluginEvalAux where
import Plugins.Make
import Plugins.Load
import Plugins.Utils
import System.Plugins.Make
import System.Plugins.Load
import System.Plugins.Utils
import Foreign.C
import Control.Exception ( evaluate )

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,6 +1,6 @@
import Plugins
import Plugins.Utils
import System.Plugins
-- import System.Plugins.Utils
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
src = "../Plugin.hs"

View File

@ -2,7 +2,7 @@
#include "../../../../config.h"
import Plugins
import System.Plugins
import API
main = do

View File

@ -3,8 +3,8 @@
-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)
--
import Eval.Haskell
import Plugins.Load
import System.Eval.Haskell
import System.Plugins.Load
import System.Exit ( ExitCode(..), exitWith )
import System.IO

View File

@ -1,6 +1,6 @@
GHCFLAGS= -O
PKGFLAGS= -package-conf $(TOP)/plugins.conf.inplace
PKGFLAGS+= -package eval -package readline
PKGFLAGS+= -package plugins -package readline
all: build

View File

@ -8,7 +8,7 @@
-- | Runplugs: use hs-plugins to run a Haskell expression under
-- controlled conditions.
--
import Eval.Haskell (unsafeEval)
import System.Eval.Haskell (unsafeEval)
import Data.Maybe (isJust, fromJust)
import Control.Monad (when)

View File

@ -1,6 +1,6 @@
GHCFLAGS= -O
PKGFLAGS= -package-conf $(TOP)/plugins.conf.inplace
PKGFLAGS+= -package eval -package unix
PKGFLAGS+= -package plugins -package unix
all: build

View File

@ -1,10 +0,0 @@
--
-- test the popen function
--
import Plugins.Utils
import System.IO
main = do
(sout,serr) <- exec "date" []
mapM_ putStrLn serr

View File

@ -1,2 +0,0 @@
TOP=../../..
include ../../eval.mk

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
-- an example where we just want to load an object and run it

View File

@ -2,7 +2,7 @@
-- a simple shell for loading plugins and evaluating their functions
--
import Plugins
import System.Plugins
import API
import Data.Either

View File

@ -1,4 +1,4 @@
import Plugins
import System.Plugins
import StringProcessorAPI
import System.Console.Readline
import System.Exit

View File

@ -1,4 +1,4 @@
import AltData
import AltData.Dynamic
import Data.Char
main = putStrLn f

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
-- an example where we just want to load an object and run it

View File

@ -1,5 +1,5 @@
import Plugins
import System.Plugins
import API
--