gregwebs / Shelly.hs

Haskell shell scripting
BSD 3-Clause "New" or "Revised" License
418 stars 88 forks source link

Conduit #59

Closed jwiegley closed 10 years ago

jwiegley commented 10 years ago

Hi Greg,

Another thing I'd like to do after the Lifted code is to add better integration of Conduits with Shelly, as a more principled way of interacting with input/output from sub-processes. This could be the basis of a new implemenation for -|-, for example, which could allow for multiple processes to be connected. It would use constant space and be equivalent to a shell-level pipe.

This PR also contains the commits from Lifted patch, so I recommend just looking at 031235e.

If this looks good to you, again I'll continue ahead.

jwiegley commented 10 years ago

Oh, and never mind the ResourceT Sh as the base for the conduit. I'll soon change this to (MonadResource m, MonadSh m) => m.

gregwebs commented 10 years ago

Is this going to be the substrate that the normal cmd and run use, or just a separate interface for streaming?

jwiegley commented 10 years ago

It can go either way, depending on your preference. I think it makes a better substrate than what we have currently, but I didn't want to presume to reinvent such a core layer of Shelly unless that's a direction you're also interested in.

gregwebs commented 10 years ago

It is definitely best to start with it separate. I am mostly interested in what users have asked for

jwiegley commented 10 years ago

Conduit works at the handle level quite nicely, too. As for the streaming find, see https://github.com/jwiegley/find-conduit/blob/master/Data/Conduit/Find.hs!

gregwebs commented 10 years ago

great! Figuring out the piping/redirecting story will inform the decision on how to integrate with conduits.

gregwebs commented 10 years ago

Lifted is into master. Is this good to merge? Want to send a new pull request so we get a proper diff now?

jwiegley commented 10 years ago

This branch still needs work, so I'll do that work and then rebase this PR.

gregwebs commented 10 years ago

thanks, no rush. You can also use origin now if you wan :)