9 Jul
2004
9 Jul
'04
9:12 a.m.
At 14:45 07/07/04 -0400, Andrew Pimlott wrote:
This can be seen as liftM2 on the reader monad ((->) r):
(.&.) = liftM2 (&&)
Thanks to those who pointed out this. I think the ((->) r) reader monad is one of those I've yet to fully grasp. #g -- At 14:45 07/07/04 -0400, Andrew Pimlott wrote:
-- combineTest :: (Bool->Bool->Bool) -> (a->Bool) -> (a->Bool) -> (a->Bool) combineTest :: (b->c->d) -> (a->b) -> (a->c) -> a -> d combineTest c t1 t2 = \a -> c (t1 a) (t2 a)
(.&.) :: (a->Bool) -> (a->Bool) -> (a->Bool) (.&.) = combineTest (&&)
This can be seen as liftM2 on the reader monad ((->) r):
(.&.) = liftM2 (&&) t1 = (>0) .&. (<=4) ans = t1 3 == True
------------ Graham Klyne For email: http://www.ninebynine.org/#Contact