[project @ 2003-06-04 14:52:09 by ralf]
[packages/old-time.git] / Control / Monad / X / tests / Writer.hs
1 import Control.Monad.X.Writer
2
3
4 t1 = test (tell "x") ((),"x")
5 t2 = test (listen (tell "x")) (((),"x"),"")
6 t3 = test
7 (do tell "x"
8 (_,y) <- listen (tell "y")
9 tell "z"
10 return y)
11 ("y","xz")
12
13 t4 = test (listen (listen (tell "x"))) ((((),"x"),""),"")
14
15 test m e = runWriter m == e
16
17 main = print $ and [t1,t2,t3,t4]
18