turtle icon indicating copy to clipboard operation
turtle copied to clipboard

Split out shell-piping :: Maybe

Open 3noch opened this issue 10 years ago • 3 comments

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?

3noch avatar Feb 03 '15 19:02 3noch

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.

Gabriella439 avatar Feb 03 '15 21:02 Gabriella439

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

3noch avatar Feb 03 '15 22:02 3noch

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).

Gabriella439 avatar Feb 03 '15 22:02 Gabriella439