!.4      !"#$%&'()*+,-./0123None=4HCLoUsed to define an arbitrary that generates a request which randomizes its response, each time it is evaluated. HCLThe Request data type represents a value requested interactively. The request may have failed or been no response, in which case the request fails. Otherwise, the request holds the response given. HCL7Runs 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't care about the result. Generally used at the top level to evaluate a request in main. HCL(Extracts the value from a given request.HCL<Takes a value and makes it into a request. Should not be an  IO (Maybe a)7 type value, unless multiply nested values is desired. 5HCL If the request given results in Nothing, Nothing is returned. Otherwise, the value held in the Just constructor is passed to the "next" function given. This is essentially the bind operation. HCLAllows IO operations in the Request type. Same as liftIO in MonadIO class (in Control.Monad.Trans module) HCLThe basic request - get a string from the user. If a newline or all whitespace is entered, the request is assumed to be a failure. HCLGets an IntegerM from the user. If the value entered cannot be converted, the request fails. HCLGets an IntM from the user. If the value entered cannot be converted, the request fails. HCLUses readsb to process a request. If the value cannot be parsed, fails. Otherwise, returns the value parsed. HCLreqChar+ requests a single character. Unlike other RequestVs, it does not wait for the user to hit enter; it simply returns the first keystroke. HCL reqPassword works like C except that it does not echo the user's input to standard output. HCL&& operator for requests (with failure). Behaves similarly, including "short-circuit" behavior. If either condition fails, the entire Request fails. HCL|| operator for requests (with failure). Behaves similarly, including "short-circuit" behavior. If either condition fails, the entire Request fails. HCLnot operator for requests.HCLIf statement for requests. HCL+Takes a value and makes it into a request. HCL#Lifts a one-argument function into Request types. HCL#Lifts a two argument function into Request\ types. The arguments to the function are evaluated in order, from left to right, since the Request monad imposes sequencing. HCL Returns true if the user answer y or YO. Allows a default to be specified, and allows failure if no default is given. HCLJAutomatic failure. Useful in menus to quit or return to the previous menu.HCLrTakes a request and guarantees a value will be returned. That is, the request is repeated until a valid (i.e. not Nothing) response is returned. HCL Like the maybe^ function, but for requests. Given a request value, a default value,and a function that maps b to  Request a, this function either returns the default if the request value is nothing, or it applies the function given to the value of the request and returns it.HCLbRuns the request while the condition given holds, then returns the result. Good for verification. HCLRRuns the request until the condition given is satisfied, then returns the result. HCL"Requests a response from user. If Nothing0 is returned, assumes default and returns that. HCL(Ask a request forever -- until failure. HCLGiven a list of items and programs to run, displays a menu of the items and runs the selected program. Very low level - usually reqMenuI is used instead. If the user selects an invalid choice, failure occurs. HCLYTakes a list of strings and requests and forms a menu out of them. Menus can built using , , , and .HCL?Used to add an individual entry to a menu that is being built. HCL_Creates a submenu within a menu. When the submenu exits, control returns to the item specified.HCL3Causes the program to exit from the current menu. HCL%Ends a list of menu item definitions. HCLHExecutes the request given and, if a failure value occurs, executes the Bool[ request given (usually some sort of prompt asking if they want to quit). If the answer is TrueL, the failure value propagates. Otherwise, the initial request is run again.!HCLTakes 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 own output (e.g. a shell maintaining an environment). "HCLNTakes a request and a "continuation" request. If the first request results in NothingW, run the second request. In either case, return the result of the successful request. #HCL2Indicates if the request failed or succceeded. If Left ()% is returned, the request failed. If Right vt is returned, the request produced a value. Though the value returned is itself a request, it will always be valid. $HCLGive 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.%HCLAGiven a request, builds a list of response. When the user enters Nothing, the list building ends &HCLPrints a message and makes a request. If the message ends in a space, it is assumed that the user should enter values on the same line. Otherwise, a new line is printed and the reqeust is evaulated. 'HCLDisplays a message prompt and a default choice in a common way. If the user doesn't provide a choice or enters bad data, the default value provided is returned. Otherwise, the value entered is returned. (HCLDeprecated name for '. )HCL:Prints a message, displays defaults (if any), and turns a Request String into a  Request Booli. If a default value is provided, it will be returned if the user enters nothing or an invalid response. 6HCLShow for requests. 7HCLEnsures required always returns a (Just _)V value. Kind of a bogus test because this will hang if required does NOT return a Just. 8HCL Test that  reqDefault< always returns a default value if the request resulted in Nothing3. Otherwise, ensure it returned the request value. 9HCLTest that bad choices don't cause exceptions. This test is noisy because it prints a lot of garbage to the screen, some of which are bell characters!:HCLTest that the andMaybeO function works as specified. Good test because >>= is implemented using it! ;HCL Ensure that reqWhich works as expected<HCL Ensure that reqMaybe works as expected.*HCLShow for requests. +HCL~Creates a request which will return a random value or Nothing. The request returns the same value every time it is evaluated. ,HCL,Allow the Request type to use IO operations.-HCL behaviour as a  MonadPlus@ allows for successive fallback requests to be used on failure. .HCLBecause we have defined  as  MonadPlus, we must also define it as  Alternative. /HCL behavior as a Monad, covers failure - when a request results in Nothingq, all bind operations fail afterwards. Thus, when one request fails, all subsequent requests automatically fail. 0HCLBecause we have defined  as Monad, we must also define it as  Applicative. 1HCLBecause we have defined  as  Applicative, we must also define it as Functor. 2HCLShow for random requests. 3HCL\Everytime the request returned is evaluated, it returns a random Just v or Nothing value. HCLRequest to run.HCL No meaningful value is returned.HCLThe request to evaluate.HCLResult of the request.HCL!The value to turn into a Request.HCLThe value as a Request.5HCLRequest to try.HCLVFunction which processes the result of the previous request and returns a new request.HCLThe new request returned.HCLIO action to performHCL&Result of the IO action, as a Request.HCL+A request that returns a string (generally ), which will then be parsed.HCLThe value parsed. HCLLeft boolean value.HCLRight boolean value.HCL Result value. HCLLeft boolean value.HCLRight boolean value.HCL Result value. HCLRequest to evaluate.HCL Result value.HCLThe test to applyHCL$Request to evaluate if test is true.HCL%Request to evaluate if test if false.HCLResult.HCLValue to make into a request.HCLResult.HCLFunction to lift.HCLArgument to function.HCLResult.HCLFunction to lift.HCLFirst argument to function.HCLSecond argument to function.HCLResult.HCLDefault value (if any).HCL.Request which gets a string (usually reqResp).HCLResult.HCLRequest to evaluate.HCLResult.HCLRequest to evaluate.HCLDefault value.HCLFunction to map b to Request a.HCLResult.HCLCondition to test.HCL,Request value to evaluate according to test.HCLResult.HCLRequest to evaluate.HCLDefault value.HCLResult.HCLRequest to ask forever.HCLResult.HCL7List of choices and labels which will be selected from.HCL/Request which gets the selection from the user.HCLResult of selection.HCL#List of request choices and labels.HCLResult.HCLThe menu to return to.HCL.The label of the submenu (in the current menu)HCLThe submenu itselfHCL;The existing menu into which this submenu will be inserted.HCL!The menu item built and returned. HCLGWhen evaluated, determines if the failure is allowed to proceed or not.HCL+The request to run and to watch for failureHCL+Result of the request (if it did not fail).!HCL3Iterative function which transforms a to Request a.HCLInitial value used.HCLResult of evaulation."HCLFirst request to evaluate.HCL7Continuation request which is evaluated if first fails.HCLResult.#HCLRequest to evaluate.HCLResult.$HCLAccumulating function.HCLInitial value.HCLRequest to evaluate.HCLResult.%HCLRequest to evaluate.HCLResult.&HCLMessage to display. HCLRequest which gathers inputHCLResult.'HCL+Message to display. Follows conventions of &.HCLRequest to evaluate.HCL#Default value to use if necessary. HCLResult.)HCL+Message to display. Follows conventions of &.HCLDefault value, if any.HCL.Request which gets a string (usually reqResp).HCLResult.*  !"#$%&'()* !" #$%&(')=      !"#$%&'()*+,-./0123456789:;<=>?HCL-1.6-DmcMZF4weCO5Js0bzGwBVJSystem.Console.HCLRequestexecReq runRequestmakeReqreqIOreqResp reqIntegerreqIntreqReadreqChar reqPasswordandReqorReqnotReqreqIfreqConstreqLiftreqLift2reqAgreereqFailrequiredreqMaybereqWhilereqUntil reqDefault reqForever reqChoicesreqMenu reqMenuItem reqSubMenu reqMenuExit reqMenuEnd reqConfirm reqIteratereqContreqWhichreqFoldlreqListpromptprompt1promptWithDefault promptAgree $fShowRequest$fArbitraryRequest$fMonadIORequest$fMonadPlusRequest$fAlternativeRequest$fMonadRequest$fApplicativeRequest$fFunctorRequest$fShowRandomRequest$fArbitraryRandomRequest RandomRequestandMaybe showRequestprop_requiredReturnsprop_reqDefaultReturnsDefaultprop_reqChoicesDoesntFailprop_andMaybeWorksprop_reqWhichWorksprop_reqMaybeWorks