{-- Example program for combining Io, Gui and Db functionality in one program. --} module Main where import MonadT import Io import Gui import Db {- set up application monad instance: -} -- not really needed here: instance Gui m => Gui (DB m) where gui = mapLift gui instance Db m => Db (GUI m) where db = mapLift db -- the monad to be used at top level: type M a = DB (GUI IO) a startM :: M () -> IO () startM = start . start -- test program: main :: IO () main = startM prog prog :: (Db m, Gui m, Io m) => m () prog = do putStrC "Hello " dbExampleOp "World" putStrC "\nHello " guiExampleOp 2001