
3 Aug
2007
3 Aug
'07
5:15 p.m.
Hi
do case x of [] -> return 1 (y:ys) -> g y >>= \temp -> f temp
See the rule about always binding to the previous line of a do block. This case then violates that.
I assumed that the example was equivalent to :
do case x of [] -> return 1 (y:ys) -> do f (<- g y)
Shouldn't the rule work then ?
If the do was inserted, then yes, this would work. Without it, it doesn't. Perhaps this makes a restriction to not inside case/let/lambda not that severe, since usually an additional do could be inserted. Thanks Neil