\      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ \\\"]^_`abcdefghijklmnopqrstuvwxyz{|}~Q`abcdeoprstuvwyz{|}~`dcbaabcdeopprstuvwyz{|}~%,%NThis record type contains all the functions that Shellac allows the pluggable L backend to provide. Most of these operations are optional and relate to T advanced features like command completion and history. However, a shell backend 7 is required to provide sensible implementations for , ,  , , and  . CProvides the backend a way to perform any necessary initialization C before the shell starts. This function is called once for each S shell instance. The generated value will be passed back in to each call of the ! other methods in this record. JCalled when the shell exits to allow the backend to perform any necessary  cleanup actions. ?Causes the string to be sent to the underlying console device. JPerform any operations necessary to clear any output buffers. After this O operation, the user should be able to view any output sent to this backend. ORetrieve a single character from the user without waiting for carriage return. =Print the prompt and retrieve a line of input from the user. "Add a string to the history list. FSet the characters which define word boundaries. This is mostly used ) for defining where completions occur. .Get the current set of word break characters. ?A callback to run whenever evaluation or a command is canceled  by the keyboard signal +A completion function that is tried first. MAn alternate function to generate completions. The function given takes the X word as an argument and generates all possible completions. This function is called @ (if set) after the attemptedCompletionFunction if it returns 'Nothing'. 1A backend-provided method to complete filenames. 1A backend-provided method to complete usernames. *An operation to clear the history buffer. BSets the maximum number of entries managed by the history buffer. BGets the maximum number of entries managed by the history buffer. CRead the history buffer from a file. The file should be formatted K as plain-text, with each line in the file representing a single command N entered, most recent commands at the bottom. (This format is what readline  produces) IWrite the history buffer to a file. The file should be formatted in the & same way as in the description for . JA datatype representing ouput to be printed. The different categories of K output are distinguished to that shell backends can, for example, apply O different colors or send output to different places (stderr versus stdout).  An string generated by an error 3An informative output string, such as command help 'The most regular way to produce output <The type of completion functions. The argument is a triple , consisting of (before,word,after), where 'word' is a string D of non-word-break characters which contains the cursor position.  'before'& is all characters on the line before 'word' and 'after' F is all characters on the line after word. The return value should  be 'Nothing'( if no completions can be generated, or  'Just (newWord,completions)'# if completions can be generated. 'newWord'  is a new string to replace 'word' on the command line and ' completions' , is a list of all possible completions of 'word'. To achieve the standard  "complete-as-far-as-possible" behavior, 'newWord' should be the longest common  prefix of all words in ' completions'. ?Provides a sane default set of characters to use when breaking  lines into 'words'+. If a backend does not have configurable  word break characters, then getWordBreakCharacters can just  return this default set. >This backend template is useful for defining custom backends. ! The idea is that you will use  to generate a A bare-bones backend implemenation and only fill in the methods ; that you wish to define using the record update syntax.  The parameter to  @ becomes the backend state associated with the backend and is 1 passed into to each of the operation methods.     (*Special commands for the shell framework. 'Causes the shell to execute a subshell HAsk the shell to continue accepting input on another line, which should # be appended to the given string EInstructs the shell to do nothing; redisplay the prompt and continue !2Causes the shell to print an informative message. : If a command name is specified, only information about " that command will be displayed "Causes the shell to exit #/The type of subshells. The tuple consists of: N A function to generate the initial subshell state from the outer shell state L A function to generate the outer shell state from the final subshell state N A function to generate the shell description from the initial subshell state $9A record type which describes the attributes of a shell. %&Commands for this shell 'The style of shell commands ('The evaluation function for this shell )$Text to print when the shell starts *7The characters upon which the backend will break words +4A shell action to run before each prompt is printed ,*A command to generate the prompt to print -;A command to generate the secondary prompt. The secondary 9 prompt is used for multi-line input. If not set, the # regular prompt is used instead. .+A function called when an exception occurs /4If set, this function provides completions when NOT % in the context of a shell command 06If set, this provides the path to a file to contain a % history of entered shell commands 12The maximum number of history entries to maintain 27If true, the history mechanism of the backend (if any) 6 will be used; false will disable history features. 3FThe type of shell commands. This monad is a state monad layered over IO.  The type parameter st/ allows the monad to carry around a package of  user-defined state. 4@The type of commands which produce output on the shell console. 5>The type of results from shell commands. They are a modified $ shell state and possibly a shell "special" action to execute. 6JThe type of a shell command. The shell description is passed in, and the  tuple consists of Q (command name,command parser,command syntax document,help message document) The type of a command parser. !The result of parsing a command. BAn incomplete parse. A word completion function may be returned. 3A complete parse. A command function is returned. 77Datatype describing the style of shell commands. This ) determines how shell input is parsed. 8(Commands consist of a single character. 9BIndicates that commands are prefixed with a particular character.  Colon ':'' is the default character (a la GHCi). :DIndicates that all input is to be interpreted as shell commands; no 4 input will be passed to the evaluation function. ( !"#$%&'()*+,-./0123456789:("!  !"#$%&'()*+,-./012%&'()*+,-./01234567:9889: ;Execute a shell action <&Output a tagged string to the console =Prints a regular output string >&Prints an informational output string ?Prints an error output string @-Prints regular output with a line terminator A=Prints an informational output string with a line terminator B6Prints and error output string with a line terminator CGet the current shell state DSet the shell state E+Apply the given funtion to the shell state FSchedule a shell "special" action. Only the last call to & this function will affect the shell's behavior! It modifies 4 a bit of state that is overwritten on each call. 3;<=>?@ABCDEF 3;<=@>A?BCDEF ;<=>?@ABCDEF GThis class is used in the V" function to automaticly generate C the command parsers and command syntax strings for user defined  commands. The type of 'f'+ is restricted to have a restricted set of  monomorphic arguments (, , , , ,  PO, NM, and LK) and the head type must be Sh st ()  ) f :: Int -> File -> Sh MyShellState ()  g :: Double -> Sh st ()  h :: Sh SomeShellState () are all legal types, whereas:  & bad1 :: a -> Sh (MyShellState a) () & bad2 :: [Int] -> Sh MyShellState ()  bad3 :: Bool -> MyShellState  are not. H>A typeclass representing user definable completion functions. I?Actually generates the list of possible completions, given the L current shell state and a string representing the beginning of the word. JAgenerates a label for the argument for use in the help displays. K4Represents a command argument which is an arbitrary 7 completable item. The type argument determines the  instance of H which is used to create * completions for this command argument. LM2Represents a command argument which is a username NO2Represents a command argument which is a filename PQBPrints the help message for this shell, which lists all avaliable J commands with their syntax and a short informative message about each. R6Print the help message for a particular shell command S3Creates a shell command which will exit the shell. the name of the command T;Creates a command which will print the shell help message. the name of the command U,Creates a command to toggle a boolean value  command name  help message getter setter V;Creates a user defined shell commmand. This relies on the " typeclass machenery defined by G. the name of the command the command function. See G for restrictions ! on the type of this function. !the help string for this command GHIJKLMNOPQRSTUVGHIJIJKLLMNNOPPQRSTUV  W@Run a shell. Given a shell description, a shell backend to use E and an initial state this function runs the shell until it exits, % and then returns the final state.     XEThe default shell exception handler. It simply prints the exception D and returns the shell state unchanged. (However, it specificaly @ ignores the thread killed exception, because that is used to " implement execution canceling) Y8Creates a simple subshell from a state mapping function  and a shell description. ,A function to generate the initial subshell $ state from the outer shell state %A shell description for the subshell IExecute a subshell, suspending the outer shell until the subshell exits. #the description of the outer shell the subshell to execute the shell backend to use the backendstate the current state the modified state WXYWXYZ3A basic shell description with sane initial values [FCreates a simple shell description from a list of shell commmands and  an evalation function. 2 !"#$%&'()*+,-./012456789:GHIJKLMNOPQRSTUVWXYZ[2$%&'()*+,-./012Z[XWSTUVGOPMNKLHIJ6#YQR7:98"! 45Z[    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ R S T U V V W W X X Y Z [ \ ] ^ _ ` abcdefghijklmnopqrstuvwxyz{|}~v>                          Shellac-0.9.1System.Console.Shell.Backend"System.Console.Shell.Backend.BasicSystem.Console.ShellSystem.Console.Shell.ShellMonad#System.Console.Shell.ConsoleHandlerSystem.Console.Shell.PPrintSystem.Console.Shell.RegexSystem.Console.Shell.TypesSystem.Console.Shell.CommandsSystem.Console.Shell.RunShell ShellBackend ShBackend initBackendshutdownBackend outputString flushOutput getSingleChargetInput addHistorysetWordBreakCharsgetWordBreakCharsonCancelsetAttemptedCompletionFunctionsetDefaultCompletionFunctioncompleteFilenamecompleteUsernameclearHistoryStatesetMaxHistoryEntriesgetMaxHistoryEntries readHistory writeHistory BackendOutput ErrorOutput InfoOutput RegularOutputCompletionFunctiondefaultWordBreakCharstemplateBackend basicBackend ShellSpecial ExecSubshellShellContinueLine ShellNothing ShellHelp ShellExitSubshellShellDescriptionShDesc shellCommands commandStyle evaluateFunc greetingTextwordBreakChars beforePromptpromptsecondaryPromptexceptionHandlerdefaultCompletions historyFilemaxHistoryEntrieshistoryEnabledSh OutputCommand CommandResult ShellCommand CommandStyleSingleCharCommandsCharPrefixCommands OnlyCommandsrunShshellPut shellPutStr shellPutInfo shellPutErr shellPutStrLnshellPutInfoLn shellPutErrLn getShellSt putShellSt modifyShellSt shellSpecialCommandFunction CompletioncompletecompletableLabel CompletableUsernameFile showShellHelp showCmdHelp exitCommand helpCommandtogglecmdrunShelldefaultExceptionHandlersimpleSubshellinitialShellDescriptionmkShellDescriptionwithControlCHandlerDocsConsNil SimpleDocSLineSTextSCharSEmptyDocNestingColumnUnionNestCatLineTextCharEmptyPrettypretty prettyListboolintintegerfloatdoublerationalflatten renderPretty renderCompactdisplayS displayIOputDochPutDocbaseGHC.Showshowlisttupled semiBraces encloseSep punctuatesepfillSephsepvsepcatfillCathcatvcat<><+><$><$$>softline softbreaksquotesdquotesbracesparensanglesbracketslparenrparenlangleranglelbracerbracelbracketrbracketsquotedquotesemicoloncommaspacedot backslashequalsstring fillBreakfillwidthindenthangalignemptychartextline linebreaknestcolumnnestinggroup RegexContext StarContext ConcatContext AltContext TopContextRegexStarAltConcatExternalTerminalLabelEpsilon showRegexparenIf matchesRegex matchRegexrunRegex strEpsilon starRegex plusRegexoptRegex manyRegex stringRegex anyOfRegex spaceRegexmaybeSpaceRegexmaybeSpaceBefore spaceAftermaybeSpaceAfter signRegexintRegex floatRegex boolRegex wordsRegex wordRegex strTerminal strConcatstrAltstrStarstrSpacestrAnyaltProjbasicGetSingleChar basicGetInput basicOutputunSh CommandParserCommandParseResultIncompleteParse CompleteParseCommandCompleterOtherCompleterUsernameCompleterFilenameCompleterghc-prim GHC.TypesInt integer-gmpGHC.Integer.TypeIntegerFloatDoubleGHC.BaseString parseCommand commandSyntax maybePrefixgetShellCommandscommandHelpDoc commandsRegexonlyCommandsRegexprefixCommandsRegexsingleCharCommandRegexInternalShellStateevalVar evalThreadVar cancelHandler backendStatecontinuedInput executeShell handleINTcompletionFunctioncompleteCommands maximalPrefix loadHistory saveHistory shellLoop runSubshell