[project @ 2003-06-04 14:52:09 by ralf]
[packages/old-time.git] / Control / Monad / X / tests / Reader.hs
1 import Control.Monad.X.Reader
2
3
4 t1 = test "x" ask "x"
5 t2 = test "x" (local ('a':) ask) "ax"
6 t3 = test "x"
7 (do x <- ask
8 y <- local ('a':) ask
9 z <- ask
10 return (x,y,z)) ("x","ax","x")
11 t4 = test "x" (local ('a':) (local ('b':) ask)) "bax"
12
13 test r m e = runReader r m == e
14
15 main = print $ and [t1,t2,t3,t4]
16