XZT5#      !"None -24=BK5ZClass of values that provide a hint for the name to use for a shell variable or function.QTo skip providing a hint, use '()'. To provide a hint, use '(NamedLike "name")'.USuggests that a shell variable or function have its name contain the specified Text.An arbitrary value.\The output of a command, or even a more complicated Script can be passed as a parameter to  Examples: cmd "echo" "hello there," (Output (cmd "whoami")) cmd "echo" "root's pwent" (Output (cmd "cat" "/etc/passwd" -|- cmd "grep" "root"))#rEnvironment built up by the shell script monad, so it knows which environment variables and functions are in use.Shell script monad.$A shell expression.%||&&&'(Piping the first Expr to the second Expr(expressions run in a sub-shell)the body of a here-doc* a comment+ a command,A shell function. A value that is safely quoted. A shell variable. %Expand a shell variable to its value. ?Quotes the value to allow it to be safely exposed to the shell.The method used is to replace ' with '"'"' and wrap the value inside single quotes. This works for POSIX shells, as well as other shells like csh.-Indents an Expr./Evaluate the monad and generates a list of Expr/NEvaluates the monad, and returns a list of Expr and the modified environment.0bRuns the passed Script, using the current environment, and returns the list of Expr it generates. PGenerates a shell script, including hashbang, suitable to be written to a file.&Generates a single line of shell code.#Adds a shell command to the script.Variadic argument version of .0The command can be passed any number of CmdArgs.Convenient usage of  requires the following: {-# LANGUAGE OverloadedStrings, ExtendedDefaultRules #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} import Control.Monad.Shell import qualified Data.Text.Lazy as L default (L.Text)!This allows writing, for example: odemo = script $ do cmd "echo" "hello, world" name <- newVar "name" readVar name cmd "echo" "hello" name1Adds an Expr to the script.>Adds a comment that is embedded in the generated shell script.Defines a new shell variable.>Each call to newVar will generate a new, unique variable name.LThe namehint can influence this name, but is modified to ensure uniqueness.4Creates a new shell variable, with an initial value.9Gets a Var that refers to a global variable, such as PATHQThis special Var expands to whatever parameters were passed to the shell script.JInside a func, it expands to whatever parameters were passed to the func. (This is $@ in shell)Takes the first positional parameter, removing it from positionalParameters and returning a new Var that holds the value of the parameter.PIf there are no more positional parameters, an error will be thrown at runtime. For example: tremovefirstfile = script $ do cmd "rm" =<< takeParameter cmd "echo" "remaining parameters:" positionalParametersVDefines a shell function, and returns an action that can be run to call the function.The action is variadic; it can be passed any number of CmdArgs. Typically, it will make sense to specify a more concrete type when defining the shell function.The shell function will be given a unique name, that is not used by any other shell function. The namehint can be used to influence the contents of the function name, which makes for more readable generated shell code. For example: Mdemo = script $ do hohoho <- mkHohoho hohoho (Val 1) echo "And I heard him exclaim, ere he rode out of sight ..." hohoho (Val 3) mkHohoho :: Script (Val Int -> Script ()) mkHohoho = func (NamedLike "hohoho") $ do num <- takeParameter forCmd (cmd "seq" "1" num) $ \_n -> cmd "echo" "Ho, ho, ho!" "Merry xmas!"Pipes together two Scripts.ANDs two Scripts.ORs two Scripts.FRuns the command, and separates its output into parts (using the IFS)BThe action is run for each part, passed a Var containing the part.BAs long as the first Script exits nonzero, runs the second script.if with a monadic conditionalEIf the conditional exits 0, the first action is run, else the second.when with a monadic conditional!unless with a monadic conditional2BCreates a block such as "do : ; cmd ; cmd" or "else : ; cmd ; cmd"The use of : ensures that the block is not empty, and allows for more regular indetnetion, as well as making the single line formatting work. DGenerates shell code to fill a variable with a line read from stdin.!By default, shell scripts continue running past commands that exit nonzero. Use "stopOnFailure True" to make the script stop on the first such command."'Makes a nonzero exit status be ignored.36Allows passing the output of a command as a parameter.4'Quoted Text arguments are passed as-is.5XVar arguments cause the (quoted) value of a shell variable to be passed to the command.6-Any value that can be shown can be passed to ; just wrap it inside a Val.7*String arguments are automatically quoted.8(Text arguments are automatically quoted.Q9:;<#=>?@$%&'()*+,A BC D -EF./0 G1HI2 !"JKLMN345678OP#  !"#   !"<9:;<#=>?@$+*)('&%,A BC D -EF./0 G1HI2 !"JKLMN345678OPQ      !"#$%&'()*+,-./0123456789:;"<=+>? @ABCDEFGHIJKLshell-monad-0.2.0Control.Monad.Shell NameHinted NamedLikeValOutputCmdArgScriptQuotedVarvalquotescript linearScriptruncmdcommentnewVarnewVarContaining globalVarpositionalParameters takeParameterfunc-|--&&--||-forCmdwhileCmdifCmdwhenCmd unlessCmdreadVar stopOnFailure ignoreFailureEnvExprOrAndPipeSubshell HereDocBodyCommentCmdFuncindentgenevalrunMaddblock$fCmdArgOutput$fCmdArgQuoted $fCmdArgVar $fCmdArgVal $fCmdArg[] $fCmdArgTexthintedShellCmdcmdAll toTextArgenvVarsenvFuncsQgetQ modifyEnvVarsmodifyEnvFuncstoLinearScriptcombineifCmd'$fNameHintedMaybe$fNameHintedNamedLike$fNameHinted()$fShellCmdScript$fShellCmd(->) $fMonoidEnv $fMonadScript