A module for shell-like / perl-like programming in Haskell.
Shelly's focus is entirely on ease of use for those coming from shell scripting.
However, it also tries to use modern libraries and techniques to keep things efficient.

The functionality provided by
this module is (unlike standard Haskell filesystem functionality)
thread-safe: each ShIO maintains its own environment and its own working
directory.

I highly recommend putting the following at the top of your program,
otherwise you will likely need either type annotations or type conversions

Entering ShIO.

Enter a ShIO from (Monad)IO. The environment and working directories are
inherited from the current process-wide values. Any subsequent changes in
processwide working directory or environment are not reflected in the
running ShIO.

variadic argument version of run.
The syntax is more convenient but it also allows the use of a FilePath as a command argument.
So an argument can be a Text or a FilePath.
a FilePath is converted to Text with toTextIgnore.
You will need to add the following to your module:

run commands over SSH.
An ssh executable is expected in your path.
Commands are in the same form as run, but given as pairs

sshPairs "server-name" [("cd", "dir"), ("rm",["-r","dir2"])]

I am not fond of this interface, but it seems to work.

Please note this sets escaping to False: the commands will not be shell escaped.
I think this should be more convenient for ssh.
Internally the list of commands are combined with the string && before given to ssh.

Environment directory

Change current working directory of ShIO. This does *not* change the
working directory of the process we are running it. Instead, ShIO keeps
track of its own workking directory and builds absolute paths internally
instead of passing down relative paths. This may have performance
repercussions if you are doing hundreds of thousands of filesystem
operations. You will want to handle these issues differently in those cases.

Get a full path to an executable on PATH, if exists. FIXME does not
respect setenv'd environment and uses findExecutable which uses the PATH inherited from the process
environment.
FIXME: findExecutable does not maintain a hash of existing commands and does a ton of file stats

Running external commands asynchronously.

Create a BgJobManager that has a limit on the max number of background tasks.
an invocation of jobs is independent of any others, and not tied to the ShIO monad in any way.
This blocks the execution of the program until all background jobs are finished.

Run the ShIO task asynchronously in the background, returns
the `BgResult a`, a promise immediately. Run getBgResult to wait for the result.
The background task will inherit the current ShIO context
The BjJobManager ensures the max jobs limit must be sufficient for the parent and all children.

Like filter, but more conveniently used with String lists, where a
substring match (TODO: also provide globs) is expressed as
grep "needle" [ "the", "stack", "of", "hay" ]. Boolean
predicates just like with filter are supported too:
grep ("fun" isPrefixOf) [...].