[Haskell-cafe] ANNOUNCE: pipes-core 0.0.1
Twan van Laarhoven
twanvl at gmail.com
Sun Mar 11 14:25:21 CET 2012
On 2012-03-11 14:09, Paolo Capriotti wrote:
>> The Category law would be broken, though:
>>
>> unawait x>>> id == yield x !== unawait x
>
> How did you get this equation? It's not even well-typed:
>
> unawait :: a -> Pipe a b m ()
> yield :: b -> Pipe a b m ()
I would expect that
(id >>> unawait x) >>> await !== unawait x >>> await === return x
because in the general case of
(p >>> unawait x)
if is impossible to transform the unawaited value out of the composition. To do
that you would need the inverse of p. You can get around this by having a
special constructor for the identity. But then
id !== arr id
IMO, neither of these failed laws would be a big problem in practice, since no
one will actually use identity pipes in combination with unawait. Or perhaps we
should be satisfied when Pipe is a Semigroupoid?
Twan
More information about the Haskell-Cafe
mailing list