[Haskell-cafe] ANNOUNCE: pipes-core 0.0.1

Twan van Laarhoven twanvl at gmail.com
Sun Mar 11 21:33:00 CET 2012


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



More information about the Haskell-Cafe mailing list