All pastes #284110 Raw Edit

Anonymous

public text v1 · immutable
#284110 ·published 2006-12-18 21:36 UTC
rendered paste body
import Control.Monad.Error
import Control.Monad.Writer

type Debug m a = ErrorT a (WriterT String m) a

test :: Debug IO String
test =
    do  
        liftIO $ print "hej"
        liftIO $ print "hej"

        debug "DEBUG!!!"
        liftIO $ print "hej"
        liftIO $ print "hu"
        return "hh"

debug s = lift $ tell s
 
assert True = return ()
assert False = return ()
 

run f = runErrorT $ runWriterT f