Gabriella439 / turtle

Shell programming, Haskell style
BSD 3-Clause "New" or "Revised" License
942 stars 90 forks source link

Split out shell-piping :: Maybe #15

Open 3noch opened 9 years ago

3noch commented 9 years ago

I am very interested in the ability mix unix-pipe streams with native Haskell streams. All I really need to do this is pipes-shell, but I was surprised to find that turtle doesn't even use that library. It must be that you're accomplishing it some other way. That functionality by itself is quite helpful. Is there a reason you implemented it differently than pipes-shell and/or why your version is not its own package?

Gabriella439 commented 9 years ago

You can find the streaming code here. It's actually quite small.

The main reason I didn't use pipes or pipes-shell is because I wanted a simpler story for exception safety. The pipes-safe story is a bit complicated and not simple enough for beginners in my eyes.

I may eventually split it out into its own library, but right now I'm just playing it cautious and bundling it with turtle.

Note that I'm not actually worried about bugs or "battle-testing it"; I already proved it is correct and the proof is not that long. The real issue is that once I split it out into a separate package people will begin asking to generalize the implementation. For example, they might ask to generalize it to any base monad instead of just IO. Keeping it within turtle more sharply narrows its scope.

3noch commented 9 years ago

Ok. That makes sense. And once you start generalizing it, you're just providing the same functionality that's already in place.

Gabriella439 commented 9 years ago

Yes. All the proofs would still work for the generalizations, basically completely unchanged (the code would be identical, but now the types would be more general).