úΕ’ (      !"#$%&':(FUsed to define an arbitrary that generates a request which randomizes *its response, each time it is evaluated. )*The Request; data type represents a value requested interactively. The Grequest may have failed or been no response, in which case the request 9fails. Otherwise, the request holds the response given. +,Runs a request, throws away the result, and  returns an IO type (rather than a Request). Useful when a request should just be run and we don'3t care about the result. Generally used at the top &level to evaluate a request in main. Request to run. !No meaningful value is returned. )Extracts the value from a given request. The request to evaluate. Result of the request. 2Takes a value and makes it into a request. Should  not be an  IO (Maybe a) type value, unless $multiply nested values is desired. "The value to turn into a Request. The value as a Request. , If the request given results in Nothing, Nothing 3is returned. Otherwise, the value held in the Just constructor is passed to the next% function given. This is essentially the bind operation. Request to try. WFunction which processes the result of the previous request and returns a new request. The new request returned. Allows IO operations in the Request type. Same as liftIO in MonadIO class (in Control.Monad.Trans module) IO action to perform 'Result of the IO action, as a Request. OThe basic request - get a string from the user. If a newline or all whitespace 5is entered, the request is assumed to be a failure. Gets an Integer: from the user. If the value entered cannot be converted, the request fails. Gets an Int> from the user. If the value entered cannot be converted, the request fails. Uses reads6 to process a request. If the value cannot be parsed, -fails. Otherwise, returns the value parsed. +A request that returns a string (generally ), which will then be parsed. The value parsed. &&D operator for requests (with failure). Behaves similarly, including  short-circuit1 behavior. If either condition fails, the entire Request fails. Left boolean value. Right boolean value. Result value. ||D operator for requests (with failure). Behaves similarly, including  short-circuit1 behavior. If either condition fails, the entire Request fails. Left boolean value. Right boolean value. Result value. not operator for requests. Request to evaluate. Result value. If statement for requests. The test to apply %Request to evaluate if test is true. &Request to evaluate if test if false. Result. ,Takes a value and makes it into a request. Value to make into a request. Result. #Lifts a one-argument function into Request types. Function to lift. Argument to function. Result. #Lifts a two argument function into Request& types. The arguments to the function 6are evaluated in order, from left to right, since the Request monad imposes  sequencing. Function to lift. First argument to function. Second argument to function. Result.  Returns true if the user answer y or Y . Allows 1a default to be specified, and allows failure if no default is given. Default value (if any). /Request which gets a string (usually reqResp). Result. KAutomatic failure. Useful in menus to quit or return to the previous menu. /Takes a request and guarantees a value will be 3returned. That is, the request is repeated until a valid (i.e. not Nothing) response is returned. Request to evaluate. Result.  Like the maybe5 function, but for requests. Given a request value, )a default value,and a function that maps b to  Request a, Jthis function either returns the default if the request value is nothing, Mor it applies the function given to the value of the request and returns it. Request to evaluate. Default value.  Function to map b to Request a. Result. 2Runs the request while the condition given holds, 1then returns the result. Good for verification. 9Runs the request until the condition given is satisfied, then returns the result. Condition to test. -Request value to evaluate according to test. Result. "Requests a response from user. If Nothing is returned, #assumes default and returns that. Request to evaluate. Default value. Result. Request to ask forever. Result. ;Given a list of items and programs to run, displays a menu Eof the items and runs the selected program. Very low level - usually reqMenu Iis used instead. If the user selects an invalid choice, failure occurs. 8List of choices and labels which will be selected from. 0Request which gets the selection from the user. Result of selection. MTakes a list of strings and requests and forms a menu out of them. Menus can  built using , , , and . $List of request choices and labels. Result. @Used to add an individual entry to a menu that is being built. `Creates a submenu within a menu. When the submenu exits, control returns to the item specified. The menu to return to. /The label of the submenu (in the current menu) The submenu itself <The existing menu into which this submenu will be inserted. "The menu item built and returned. 4Causes the program to exit from the current menu. &Ends a list of menu item definitions. ;Executes the request given and, if a failure value occurs,  executes the Bool3 request given (usually some sort of prompt asking (if they want to quit). If the answer is True+, the failure value propagates. Otherwise, "the initial request is run again. HWhen evaluated, determines if the failure is allowed to proceed or not. ,The request to run and to watch for failure ,Result of the request (if it did not fail). =Takes an initial value and function which produces a request ;from that value. Applies the function to the initial value @and then recurses. Useful for functions which operate off their 7own output (e.g. a shell maintaining an environment). 4Iterative function which transforms a to Request a. Initial value used. Result of evaulation. Takes a request and a  continuation request. If the first request results in Nothing, run the second request. >In either case, return the result of the successful request. First request to evaluate. 8Continuation request which is evaluated if first fails. Result. !Request to evaluate. Result. "Give a function from a -> b, an initial value, and a Request for a , builds a Request for b. When  (Request a) fails, #then the function returns whatever  (Request b) has been built. Accumulating function. Initial value. Request to evaluate. Result. #1Given a request, builds a list of response. When the user enters Nothing, the list building ends Request to evaluate. Result. $TPrints a message and makes a request. If the message ends in a space, it is assumed Uthat the user should enter values on the same line. Otherwise, a new line is printed and the reqeust is evaulated. Message to display. Request which gathers input Result. %CDisplays a message prompt and a default choice in a common way. If the user doesn'Bt provide a choice or enters bad data, the default value provided 8is returned. Otherwise, the value entered is returned. Deprecated name for prompt1. +Message to display. Follows conventions of $. Request to evaluate. $Default value to use if necessary. Result. &'2Prints a message, displays defaults (if any), and turns a Request String into a  Request Bool. If 8a default value is provided, it will be returned if the -user enters nothing or an invalid response. +Message to display. Follows conventions of $. Default value, if any. /Request which gets a string (usually reqResp). Result. -Show for requests. Ensures required always returns a (Just _) value. Kind of B a bogus test because this will hang if required does NOT return  a Just. . Test that  reqDefault/ always returns a default value if the request  resulted in Nothing4. Otherwise, ensure it returned the request value. /Test that bad choices don':t cause exceptions. This test is noisy because it prints D a lot of garbage to the screen, some of which are bell characters! 0Test that the andMaybe0 function works as specified. Good test because  >>= is implemented using it! 1 Ensure that reqWhich works as expected 2 Ensure that reqMaybe works as expected. 3Show for requests. 4Show for random requests. 5CQuickCheck does not define arbitrary for Chars for some reason ... 6CCreates a request which will return a random value or Nothing. The <request returns the same value every time it is evaluated. 7AEverytime the request returned is evaluated, it returns a random  Just v or Nothing value. 8-Allow the Request type to use IO operations. 9Request behavior as a Monad covers failure - when a request results in Nothing , all bind :operations fail afterwards. Thus, when one request fails, -all subsequent requests automatically fail. (  !"#$%&'(  !"#$&%'(  !"#$%&':      !"#$%&'()**+,-./0123456789:HCL-1.4System.Console.HCLRequestexecReq runRequestmakeReqreqIOreqResp reqIntegerreqIntreqReadandReqorReqnotReqreqIfreqConstreqLiftreqLift2reqAgreereqFailrequiredreqMaybereqWhilereqUntil reqDefault reqForever reqChoicesreqMenu reqMenuItem reqSubMenu reqMenuExit reqMenuEnd reqConfirm reqIteratereqContreqWhichreqFoldlreqListpromptprompt1promptWithDefault promptAgree RandomRequestrequestandMaybeprop_requiredReturnsprop_reqDefaultReturnsDefaultprop_reqChoicesDoesntFailprop_andMaybeWorksprop_reqWhichWorksprop_reqMaybeWorks $fShowRequest$fShowRandomRequest$fArbitraryChar$fArbitraryRequest$fArbitraryRandomRequest$fMonadIORequest$fMonadRequest