Safe Haskell | None |
---|

Shortcuts for Bash generation that also demonstrate use of the library.

- cmd :: Expression t -> [Expression t] -> Statement t
- esed :: Monoid m => Identifier -> Annotated m
- for :: (Monoid m, Integral i, Show i) => Identifier -> i -> i -> Annotated m -> Statement m
- seqAZ :: (Integral i, Show i) => i -> i -> Statement t
- setSafe :: Statement t
- sudo_write :: Monoid m => Expression m -> Statement m
- dev_null :: Monoid m => Statement m -> Statement m
- ann_ :: Monoid m => Statement m -> Annotated m

# Documentation

cmd :: Expression t -> [Expression t] -> Statement tSource

Create a simple command from expressions.

esed :: Monoid m => Identifier -> Annotated mSource

Declare or assign an array to a `sed`

command line that will use extended
regular expressions, checking for GNU or BSD `sed`

. The `Bool`

argument
determines whether to insert the declaration or not.

for :: (Monoid m, Integral i, Show i) => Identifier -> i -> i -> Annotated m -> Statement mSource

Perform a statement for integer values ranging from the first integral
parameter to the second, using `seq`

.

A set statement that covers a few error handling options, setting
`errexit`

, `nounset`

and `pipefail`

.

sudo_write :: Monoid m => Expression m -> Statement mSource

A statement that allows one to redirect output to a file as root. This is
what you might expect `sudo echo x > privileged_file`

would do (though
that does not actually work).