utdemir
utdemir

Reputation: 27216

Lifting a pipe to work on tuples

I need a function with type Pipe a b m r -> Pipe (a, c) (b, c) m r.

But no matter how much I play with for, ~> or >~; I can not match the types properly.

Can you help me?

Upvotes: 1

Views: 102

Answers (1)

Daniel Wagner
Daniel Wagner

Reputation: 152682

I don't think it's possible in general. Suppose we did manage to write it:

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

What behavior should hypotheticalLift (yield b) have? Presumably it should be the same as yield (b, c) for some c -- but which c, and why?

Upvotes: 4

Related Questions