
7 Nov
2005
7 Nov
'05
4:32 p.m.
Folks, I'm trying to monadify http://research.microsoft.com/~akenn/fun/ picklercombinators.pdf appU is easy but I can't figure out the appP. Is it actually possible? The clever trick seems to be the passing of (b -> a) into sequ for use in appP. -- instance Monad (PU s) where return a = PU snd (\s -> (a, s)) -- how do I do appP below? pa >>= k = PU (\(b, s) -> let pb = k a in appP pa (a, ??? -- this is good (\s -> let (a, s1) = appU pa s pb = k a in appU pb s1) Thanks, Joel -- http://wagerlabs.com/