"process-streaming" is more like a set of helper functions for "process"; it doesn't provide formatting, regexps, or OS-independent implementations of typical shell commands. It does support piping of processes, though.
Why `Either Text Text`? What if you're interested in both stdout and stderr?
Re:Use Haskell for shell scripting
by Gabriel439 on Friday January 30, 2015 @06:58PM
(#8975268)
Then you can do this:
fmap (either id id) (both ...)
... which is equivalent to: x <- both ...
return (case x of
Left txt -> txt
Right txt -> txt)
That removes the `Either` tag and fuses them into a single stream.Thanks for this elaborate response.
Re:Use Haskell for shell scripting
by Gabriel439 on Friday January 30, 2015 @11:51AM
(#8972871)
You're welcome!
The main reason I rolled my own library is that this was written with the specific audience of people who didn't know any Haskell, but were comfortable with Python or Bash. My actual goal is to convince people internally at Twitter to use Haskell instead of Python for large scripts. I reviewed all those libraries (with the exception of shell_monad) to see if I felt comfortable marketing them to non-Haskell programmers and none of them felt like the right level of abstraction to me. I almost ended up going with Shelly, but in the process of polishing shelly for internal usage I found myself continually wrapping things with better names, different types, and providing missing features to get a single import umbrella, so I just stopped and asked: "why not just do this as a cohesive single library instead?". Also, `shelly` does not provide any `IO`-only commands: everything has to be wrapped in the `Sh` monad.
As for the other libraries, `shell-conduit` was too complex for new users in my opinion and `hell` is not embedded within Haskell (it's a separate language), and I wanted to keep the features of Haskell. I still need some more time to review `shell_monad` to see if I made a mistake by ignoring it.