Gabriella439 / pipes

Compositional pipelines
BSD 3-Clause "New" or "Revised" License
487 stars 72 forks source link

Added pipes graphic to 'for' documentation #141

Closed mitchellwrosen closed 9 years ago

mitchellwrosen commented 9 years ago

I found the pipes graphics from Pipes.Tutorial really helpful. Do you think it would be overkill to add them to the documentation for pipes combinators as well? This patch includes just one example but I'll gladly make the rest if you think it's a good idea.

Gabriella439 commented 9 years ago

Yeah, definitely! Only one minor nitpick: could you connect the b and b' in the first two like the examples from Pipes.Core (such as this one)?

mitchellwrosen commented 9 years ago

Oh yeah! I forgot about those. How about the "simplified" functions ('for' vs. (//>)) are coupled with simplified diagrams, and a hyperlink to the more general one? I've updated the PR to show you what I mean.

Gabriella439 commented 9 years ago

That sounds like a good idea. The only thing I'd suggest is omitting the x from the simplified diagram for for.

mitchellwrosen commented 9 years ago

Even though it's part of the downstream flow? Just above the diagram are aliases to 'for' which include Pipe x b m r -> (b -> Pipe x c m ()) -> Pipe x c m r and others.

Another thought, I think the type variables in the "real" and "equivalent" type signatures should match up, i.e. either change a' to r or vice-versa. However, I'm sure you had a good reason for naming the result type a' so feel free to veto this as well :)

Gabriella439 commented 9 years ago

Never mind. Keep it the way it is. I realized that you were aiming for the most general unidirectional version.