---------------------------------------------------------------- -- Daan Leijen (c) 2001 -- -- $Revision$ -- $Author$ -- $Date$ ---------------------------------------------------------------- module LvmLibTest where import LvmLang( bindIO, ''::'', '':[]'', unsafePerformStrictIO ) import LvmException( catch, error, UserError ) import LvmIO( outputString, stdout, outputPacked ) {---------------------------------------------------------- Test ----------------------------------------------------------} hoi :: String hoi = ['h','o','i'] user :: String user = ['u','s','e','r'] err :: String err = ['e','r','r'] unk :: String unk = ['u','n','k'] main :: IO () main = unsafePerformStrictIO ( catch (bindIO (outputString stdout hoi) (\_ -> error user)) (\exn -> case exn of UserError usr -> outputPacked stdout usr default -> outputString stdout unk ) )