Dr/      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-Inferred 1Operations we can perform while pretty printing. Introduce a level of parens. Introduce a level of braces. Separate words with space. Move to newline. Add bytes to the script. Remove an indentation level. Indent by N spaces. GState of pretty printing -- string being built, indent levels, present  column, brace nesting. ;Produce a builder from a pretty printer state computation. JPretty printer state starting on a new line indented to the given column. Apply an operation to a state. !FThis procedure is used in printing statements within evals, to set up $ indentation correctly for lines  following the first line. It ensures K that the second and following lines are printed aligned with the first M character of the first line of the statement, not the first character of  the $(, >( or <( enclosing the eval. %  !"#$  !"#$  !"#  !"#None(Unused at present. R Redirection " directions". SAppending output, >>. TOutput redirection, >. UInput redirection, <. V@A file descriptor in Bash is simply a number between 0 and 255. ]HThe names of special variables, with otherwise illegal identifiers, are  represented by this type. mGBash functions can have surprising names. Once the word containing the J name of the function has been identified by the Bash parser, the only K constraint as of this writing is that it not be all digits and contain I neither quotes nor dollar signs. Thus the following are all callable  functions:  N function http://duckduckgo.com { curl -sSfL http://duckduckgo.com?q="$1" ;} ! function 123.0 { echo 123.0 ;} 3 function + { echo "$@" | sed 's/ / + /g' | bc ;} HYet a function name may only be parsed if its surroundings constitute a O valid function declaration. So we are not able to declare these functions:  + function par()ens { echo '(' "$@" ')' ;} + function (parens) { echo '(' "$@" ')' ;} K(The parser thinks the parens are there to separate the function name from  the function body.) <Some functions can be declared but not called. For example:   function for { echo for ;}  function x=y { echo x is y ;} FCalling the former results in a syntax error. A call to the latter is  parsed as an assignment. JIt is possible to override important builtins with function declarations.  For example:   function set { echo Haha! ;} ' function declare { echo Surprise! ;} EOverall, Bash function names are quite flexible but inconsistent and ) potentially a cause of grave errors. pFThe type of legal Bash identifiers, strings beginning with letters or _  and containing letters, _ and digits. uKThe type of Bash expressions, handling many kinds of variable reference as 1 well as eval and process substitution. It is  and a . The 9 type captures the different kind of statements that may B exist in a Bash statement tree. It is mutually recursive with .  It is a  and a . The 3 type captures the annotatedness of a tree of Bash  statements. It is  and a .  Escape a " to produce a literal expression.  Produce an p from a  of legal format.  Produce a m, choosing the o constructor if the name is a  simple identifier. Try to render a ] from a . $%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~u~}|{zyxwvrtspqmon]lkjihgfedcba`_^X\[ZYVWRUTS(QPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)$'&%$'&%()QPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)RUTSVWX\[ZY]lkjihgfedcba`_^monpqrtsu~}|{zyxwvNone'%None*Create a simple command from expressions.  Declare or assign an array to a sed% command line that will use extended 1 regular expressions, checking for GNU or BSD sed. The  argument 9 determines whether to insert the declaration or not. GPerform a statement for integer values ranging from the first integral # parameter to the second, using seq.  Evaluate seq for the given arguments. BA set statement that covers a few error handling options, setting  errexit, nounset and pipefail. JA 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). JA 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). 3Annotate a statement with the 0 value of a monoid. NoneFAnnotate a statement with statements of different types, with special  rules for empty  statements -- as long as the   "comment" in the  is empty, the  is simply elided. =Append some raw lines, in flow, above and below a statement. None Produce a script beginning with #!/bin/bash and a safe set statement.  Produce a script beginning with #!/bin/bash and some (optional) N documentation. Cause the script to be scanned for SHA-1 hash of the setup K (first statement argument) and main (second statement argument) before D running the safe set statement and running the second argument. Scan $0? for the token before running, producing a statement annotated M with the initial statement. This is a bit clumsy but is used internally. Scan $0< for the token before running, correctly producing monoidal F annotations. The function argument provides an annotation for the fgrep . check generated to search for the token. ( const mempty would be  appropriate in most cases.) Scan $0+ the SHA1 of the statement before running. The noop dance -- annotate a $ with a statement, essentially as a  type coercion. Nonea$%&'RSTUVW]mnoprstuvwxyz{|}~Uu~}|{zyxwvp]rtsmonRUTSVW$'&%      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]]^_`abcdefghijklmnopqrstuvvwxyz{|}~^ bash-0.1.8!Language.Bash.PrettyPrinter.StateLanguage.Bash.SyntaxLanguage.Bash.PrettyPrinterLanguage.Bash.LibLanguage.Bash.AnnotationsLanguage.Bash.Script Language.BashPPOpRoundCurly WordSeparatorNewlineBytesOutdentIndentPPStateindentscurlyroundcolumns separatedstringrender renderBytesnlColopopMnlhanghangWordwordwordcatoutdentinwordoutword curlyOpen curlyClose roundOpen roundCloseindentPadToNextWordcast renderIndents AssignmentDictArrayVarConditionalExpressionOrAndNotNumGEqNumGTNumLEqNumLTNumNotEqNumEqStringREStringGTStringLT StringNotEqStringEqStringNonempty StringEmptyOptSetFile_efFile_otFile_ntFile_NFile_SFile_LFile_GFile_OFile_xFile_wFile_uFile_tFile_sFile_rFile_pFile_kFile_hFile_gFile_fFile_eFile_dFile_cFile_bFile_a RedirectionAppendOutInFileDescriptorTrimLongestTrailingShortestTrailingLongestLeadingShortestLeading SpecialVarDollar9Dollar8Dollar7Dollar6Dollar5Dollar4Dollar3Dollar2Dollar1Dollar0DollarUnderscore DollarBang DollarDollar DollarHyphenDollarQuestionFuncNameFancySimple IdentifierVarName VarSpecialVarIdent Expression ProcessOut ProcessIn EvalUnquotedEvalConcat ArrayLengthLengthKeys ElementsSafeElements ARGVLength ARGVElements ReadArraySafe ReadArray ReadVarSafeReadVarTilde QuestionMarkAsteriskLiteral StatementRedirect DictUpdate ArrayUpdateIsSetExportLocalDeclareAssignUntilWhileCaseFor IfThenElseIfThenFunctionSubshellGroup BackgroundSequencePipeOrOrAndAndBangNoOp SimpleCommandEmpty Annotated annotation statementliteralvarName identifierfuncName specialVarspecialVarBytesPPpp Annotationannotatebytesbuilder bytes_statehangcatarray_ppkeyset case_clauserender_redirectquotebracesbraces0braces_brackets identpart trimPrinterisSimpleisAndAndisOrOrisPipebinGrp redirectGrp breakline hangMultiline maxLineLengthfinalLineLengthinlineEvalPrinter escapeWordscmdesedforseqAZsetSafe sudo_writedev_nullann_ StatementsLinesscript script_sha1 tokenCheck mtokenCheck tokenFGREPq sha1Checksha1dancenoop $fShowPPStatebase Data.FoldableFoldableGHC.BaseFunctorbytestring-0.10.0.2Data.ByteString.Internal ByteString$fFoldableAssignment$fFunctorAssignment$fIsStringSpecialVar$fIsStringFuncName$fIsStringIdentifier$fIsStringVarName$fFoldableExpression$fFunctorExpression$fIsStringExpression$fFoldableStatement$fFunctorStatement$fFoldableAnnotated$fFunctorAnnotated $fPPStatement $fPPAnnotated$fPPExpression$fPPFileDescriptor$fPPSpecialVar $fPPFuncName$fPPIdentifier$fAnnotation()ghc-prim GHC.TypesBool$fAnnotation(,)$fAnnotationStatements$fAnnotationLines