projects
/
ghc-base.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 2003-06-03 22:26:44 by diatchki]
[ghc-base.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