
11 Mar
2012
11 Mar
'12
4:33 p.m.
On 2012-03-11 17:30, Mario Blažević wrote:
It's difficult to say without having the implementation of both unawait and all the combinators in one package. I'll assume the following equations hold:
unawait x >> await = return x unawait x >> yield y = yield y >> unawait x (p1 >> unawait x) >>> p2 = (p1 >>> p2) <* unawait x -- this one tripped me up first (unawait (x, y)) = unawait x
I think you should instead move unwaits in and out of the composition on the left side: unawait x >> (p1 >+> p2) === (unawait x >> p1) >+> p2 This makes idP a left-identity for (>+>), but not a right-identity, since you can't move unawaits in and out of p2. Twan