提升管道以处理元组

Lifting a pipe to work on tuples

我需要一个类型为 Pipe a b m r -> Pipe (a, c) (b, c) m r 的函数。

但无论我玩多少 for~>>~;我无法正确匹配类型。

你能帮帮我吗?

我认为一般情况下是不可能的。假设我们确实设法写了它:

hypotheticalLift :: Pipe a b m r -> Pipe (a, c) (b, c) m r

hypotheticalLift (yield b) 应该有什么行为?据推测它应该与某些 cyield (b, c) 相同——但是 c,为什么?