
12 Feb
2009
12 Feb
'09
6:36 p.m.
Hi, I can desugar do x' <- x f x' as x >>= \x -> f x' which is clearly the same as x >>= f However, now consider do x' <- x y' <- y f x' y' desugared, this is x >>= \x -> y >>= \y' -> f x' y' I can simplify the second half to x >>= \x -> y >>= f x' but now we are stuck. I feel it should be possible to write something like x ... y ... f or perhaps f ... x ... y the best I could come up with was join $ return f `ap` x `ap` y which is not terrible but quite as easy as I feel this should be. Any hints? Edsko