Îõ³h$ndiÑ­      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬ None   ;<=>?  ?><=;NoneX Safe-Inferred‡$ !"#$%&'()*+,-./012345678:9$:9 $#-8(+*%)0'&"!654321/.7, NoneíÀ    !"#$%&'()*+,-./012345678:9;<=>?None ; @ core-programµInformation about the version number of this piece of software and other related metadata related to the project it was built from. This is supplied to your program when you call  À. This value is used if the user requests it by specifying the  --version option on the command-line.>Simply providing an overloaded string literal such as version "1.0" will give you a @ with that value: ,{-# LANGUAGE OverloadedStrings #-} main :: ­ () main = do context <-   "1.0"   (  ... *For more complex usage you can populate a @ object using the D9 splice below. You can then call various accessors like C to access individual fields.D core-programúThis is a splice which includes key built-time metadata, including the number from the version field from your project's .cabal- file (as written by hand or generated from  package.yaml).üWhile we generally discourage the use of Template Haskell by beginners (there are more important things to learn first) it is a way to execute code at compile time and that is what what we need in order to have the version number extracted from the .cabalÙ file rather than requiring the user to specify (and synchronize) it in multiple places.ÅTo use this, enable the Template Haskell language extension in your Main.hs file. Then use the special $( ... )? "insert splice here" syntax that extension provides to get a @6 object with the desired metadata about your project: -{-# LANGUAGE TemplateHaskell #-} version :: @ version = $(D ) main :: ­ () main = do context <-   version   (  ... è(Using Template Haskell slows down compilation of this file, but the upside of this technique is that it avoids linking the Haskell build machinery into your executable, saving you about 10 MB in the size of the resultant binary)@BCAD@DCABNone 5Îî7H core-programÁDifferent ways parsing a simple or complex command-line can fail.I core-programÍSomething was wrong with the way the user specified [usually a short] option.J core-programÎUser specified an option that doesn't match any in the supplied configuration.K core-program1Arguments are mandatory, and this one is missing.L core-program+Arguments are present we weren't expecting.M core-programáIn a complex configuration, user specified a command that doesn't match any in the configuration.N core-program:In a complex configuration, user didn't specify a command.O core-programÁIn a complex configuration, usage information was requested with --help., either globally or for the supplied command.P core-program.Display of the program version requested with  --version.Q core-program‡Result of having processed the command-line and the environment. You get at the parsed command-line options and arguments by calling  within a  block.‚Each option and mandatory argument parsed from the command-line is either standalone (in the case of switches and flags, such as --quiet¼) or has an associated value. In the case of options the key is the name of the option, and for arguments it is the implicit name specified when setting up the program. For example, in: 2$ ./submit --username=gbmh GraceHopper_Resume.pdf the option has parameter name "username " and value "gmbhÛ"; the argument has parameter name "filename" (assuming that is what was declared in the [Ç entry) and a value being the Admiral's CV. This would be returned as: Q ®Á [("username","gbmh"), ("filename","GraceHopper_Resume.pdf")] [] &The case of a complex command such as git or stackÏ, you get the specific mode chosen by the user returned in the first position: $ missiles launch --all would be parsed as: Q (¯ "launch") [("all",Empty)] [] V core-program¼Individual parameters read in off the command-line can either have a value (in the case of arguments and options taking a value) or be empty (in the case of options that are just flags).Y core-programÏDeclaration of an optional switch or mandatory argument expected by a program.Zì takes a long name for the option, a short single character abbreviation if offered for convenience, whether or not the option takes a value (and what label to show in help output) and a description for use when displaying usage via --help.[’ indicates a mandatory argument and takes the long name used to identify the parsed value from the command-line, and likewise a description for --help output.1By convention option and argument names are both  lower caseÒ. If the identifier is two or more words they are joined with a hyphen. Examples:  [ Z "quiet" (¯ 'q') X* "Keep the noise to a minimum." , Z "dry-run" ® (WÒ "TIME") "Run a simulation of what would happen at the specified time." , [< "username" "The user to delete from the system." ] By convention a  descriptionë is one or more complete sentences each of which ends with a full stop. For options that take values, use  upper case6 when specifying the label to be used in help output.\ declares an environment variableì that, if present, will be read by the program and stored in its runtime context. By convention these are  upper caseÍ. If the identifier is two or more words they are joined with an underscore:  [ ... , \Î "CRAZY_MODE" "Specify how many crazies to activate." , ... ] ] core-programÃDescription of the command-line structure of a program which has "commands" (sometimes referred to as "subcommands") representing different modes of operation. This is familiar from tools like git and docker.` core-programÏThe setup for parsing the command-line arguments of your program. You build a Config with f or g, and pass it to  .a core-program:The name of an option, command, or agument (omitting the "--ç" prefix in the case of options). This identifier will be used to generate usage text in response to --helpë and by you later when retreiving the values of the supplied parameters after the program has initialized.Turn on OverloadedStrings+ when specifying configurations, obviously.c core-programùThe description of an option, command, or environment variable (for use when rendering usage information in response to --help on the command-line).d core-program-Single letter "short" options (omitting the "-" prefix, obviously).e core-programÄA completely empty configuration, without the default debugging and logging options. Your program won't process any command-line options or arguments, which would be weird in most cases. Prefer f.f core-program‰Declare a simple (as in normal) configuration for a program with any number of optional parameters and mandatory arguments. For example: main :: ­ () main = do context <-   "1.0"   (f [ Z "host" (¯ 'h') X [°—| Specify an alternate host to connect to when performing the frobnication. The default is "localhost". |] , Z "port" (¯ 'p') X [°à| Specify an alternate port to connect to when frobnicating. |] , Z "dry-run" ® (W "TIME") [°û| Perform a trial run at the specified time but don't actually do anything. |] , Z "quiet" (¯ 'q') X [°<| Supress normal output. |] , [ "filename" [°Ì| The file you want to frobnicate. |] ])  context program 3which, if you build that into an executable called snippet and invoke it with --help, would result in: $ ./snippet --helpÉ Usage: snippet [OPTIONS] filename Available options: -h, --host Specify an alternate host to connect to when performing the frobnication. The default is "localhost". -p, --port Specify an alternate port to connect to when frobnicating. --dry-run=TIME Perform a trial run at the specified time but don't actually do anything. -q, --quiet Supress normal output. -v, --verbose Turn on event tracing. By default the logging stream will go to standard output on your terminal. --debug Turn on debug level logging. Implies --verbose. Required arguments: filename The file you want to frobnicate. $ | ÎFor information on how to use the multi-line string literals shown here, see ° in Core.Text.Utilities.g core-programÖDeclare a complex configuration (implying a larger tool with various "[sub]commands" or "modes"} for a program. You can specify global options applicable to all commands, a list of commands, and environment variables that will be honoured by the program. Each command can have a list of local options and arguments as needed. For example:  program :: * MusicAppStatus () program = ... main :: ­ () main = do context <-   ( version) ± (g [ ^ [ Z "station-name" ® (W "NAME") [°©| Specify an alternate radio station to connect to when performing actions. The default is "BBC Radio 1". |] , \ "PLAYER_FORCE_HEADPHONES" [°| If set to 1Œ, override the audio subsystem to force output to go to the user's headphone jack. |] ] , _( "play" "Play the music." [ Z "repeat" ® X [°Ü| Request that they play the same song over and over and over again, simulating the effect of listening to a Top 40 radio station. |] ] , _ "rate" "Vote on whether you like the song or not." [ Z "academic" ® X [°| The rating you wish to apply, from A+ to F. This is the default, so there is no reason whatsoever to specify this. But some people are obsessive, compulsive, and have time on their hands. |] , Z "numeric" ® X [°¶| Specify a score as a number from 0 to 100 instead of an academic style letter grade. Note that negative values are not valid scores, despite how vicerally satisfying that would be for music produced in the 1970s. |] , Z "unicode" (¯ 'c') X [°î| Instead of a score, indicate your rating with a single character. This allows you to use emoji, so that you can rate a piece '©é', as so many songs deserve. |] , [ "score" [°ß| The rating you wish to apply. |] ] ])  context program ÷is a program with one global option (in addition to the default ones) [and an environment variable] and two commands: play, with one option; and rate, with two options and a required argument. It also is set up to carry its top-level application state around in a type called MusicAppStatus (implementing ² and so initialized here with ±Ò. This is a good pattern to use given we are so early in the program's lifetime).Embelish a program with useful behaviours. See module header Core.Program.Execute= for a detailed description. Internally this function calls ‰/ with an appropriate default when initializing.” core-program¼Embelish a program with useful behaviours, supplying a configuration for command-line options & argument parsing and an initial value for the top-level application state, if appropriate.• core-program‹Safely exit the program with the supplied exit code. Current output and debug queues will be flushed, and then the process will terminate.— core-programÒChange the verbosity level of the program's logging output. This changes whether Ž and the : family of functions emit to the logging stream; they do not affect ‹3ing to the terminal on the standard output stream.˜ core-programøOverride the program name used for logging, etc. At least, that was the idea. Nothing makes use of this at the moment. :/™ core-programÌGet the program name as invoked from the command-line (or as overridden by ˜).š core-program5Retreive the current terminal's width, in characters.'If you are outputting an object with a ; instance then you may not need this; you can instead use wrteRå which is aware of the width of your terminal and will reflow (in as much as the underlying type's Render instance lets it).› core-programÃGet the user supplied application state as originally supplied to ‰/ and modified subsequntly by replacement with œ. ! state <- getApplicationState œ core-program5Update the user supplied top-level application state. Æ let state' = state { answer = 42 } setApplicationState state'  core-programž core-programŸ core-programWrite the supplied Bytes to the given Handle. Note that in contrast to ‹$ we don't output a trailing newline.    h b Do not use this to output to stdout1 as that would bypass the mechanism used by the ‹*, Ž, and Ô* functions to sequence output correctly. If you wish to write to the terminal use:  ‹ (É b) (which is not unsafeà, but will lead to unexpected results if the binary blob you pass in is other than UTF-8 text).  core-program¡ core-program,Read the (entire) contents of the specified Handle.¢ core-program¤ core-program5Fork a thread. The child thread will run in the same Context as the calling Program=, including sharing the user-defined application state type. (this wraps async's Ê which in turn wraps base's )¥ core-programéPause the current thread for the given number of seconds. For example, to delay a second and a half, do:  ¥ 1.5  (this wraps base's Ë)¦ core-programîRetrieve the values of parameters parsed from options and arguments supplied by the user on the command-line..The command-line parameters are returned in a Ìé, mapping from from the option or argument name to the supplied value. You can query this map directly: program = do params <- ¦ let result = Í "silence" (paramterValuesFrom params) case result of ® -> Î () ¯# quiet = case quiet of W _ -> ?Ò NotQuiteRight -- complain that flag doesn't take value X -> ‹4 "You should be quiet now" -- much better ... ·which is pattern matching to answer "was this option specified by the user?" or "what was the value of this [mandatory] argument?", and then "if so, did the parameter have a value?"=This is available should you need to differentiate between a Value and an Empty V7, but for many cases as a convenience you can use the ©, ¨, and §Ý functions below (which are just wrappers around a code block like the example shown here).§ core-programArguments are mandatory, so by the time your program is running a value has already been identified. This returns the value for that parameter.¨ core-programÐLook to see if the user supplied a valued option and if so, what its value was.© core-programReturns  Just True if the option is present, and Nothing if it is not.ª core-programçIllegal internal state resulting from what should be unreachable code or otherwise a programmer error. }‚ƒ„…†‰’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª }‰“”•¦©¨§™˜–—š›œŸ¡’¤¥„‚ƒ…†£ªž ¢None ÁÂÔÙh;« core-program>This gives you a function that you can use within your lifted ­ actions to return to the } monad.ðThe type signature of this function is a bit involved, but the example below shows that the lambda gives you a function, as its argument (we recommend you name it  runProgram¦ for consistency) which gives you a way to run a subprogram, be that a single action like writing to terminal or logging, or a larger action in a do-notation block: main :: IO () main = “ $ do «Æ $ \runProgram -> do -- in IO monad, lifted -- (just as if you had used liftIO) ... runProgram $ do -- now unlifted, back to Program monad ... Think of this as  with an escape hatch.This function is named «; because it is a convenience around the following pattern:  context <- ‡% liftIO $ do ... ˆ> context $ do -- now in Program monad ... ‡ˆ««‡ˆ None i"¬ core-program+Watch for changes to a given list of files.øBefore continuing we insert a 100ms pause to allow whatever the editor was to finish its write and switcheroo sequence.¬¬NoneiDÚ@BCADHPONMLKIJQRUSTVWXY\Z[]^_`abcdefghijkl}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬Ï !"#"$%&'()*+,+-+.+/010203040567+89:;9:<9:=9:=>?@>AB>AC>AD>AE>AF>AG>AH>AI>AJ>?K>?L>?M>?N>?O>?P>?Q>?R>?S>?T>?U>?V>?W>?X>?Y>?Z>?[>?\>?]>?^>?_>?`>?a>?b>?c>?defgefhefiefjefklmnopqrstuvwxyz{||}~€‚ƒ„…†‡ˆ‰Š‹‹ŒŽ ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨  ©ª«¬­ ®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉ ÊËÌÍÎÏÎÐÑÒÓÔÕÔÖ×ØØ©ÙÚÛÜÝÞßàáâãäå%æÑÒçäèÑÒéêëÑìíéêîïðñòóñòôÔõö+core-program-0.2.6.0-D86OXhsucfyHp4HCvB2MDlCore.System.BaseCore.System.ExternalCore.System.PrettyCore.Program.MetadataCore.Program.ArgumentsCore.Program.ExecuteCore.Program.LoggingCore.Program.UnliftCore.Program.Notify Core.System configureNonesimplegetCommandLineProgramCore.Program.Context executeWith fromPackageexecutesetVerbosityLevelgetApplicationStatesetApplicationStateCore.Program.SignalCore.Text.UntilitiesRenderControl.ConcurrentforkIO Core.ProgrambaseGHC.IO.Handle.FDstdoutGHC.IO.Handle.TypesHandleControl.Monad.IO.ClassliftIOMonadIO System.IOwithFilestderrstdin GHC.IO.HandlehFlushGHC.Exception.TypedisplayException fromException toException Exception GHC.IO.IOMode ReadWriteMode AppendMode WriteModeReadModeIOMode GHC.IO.UnsafeunsafePerformIO SomeException,chronologique-0.3.1.3-HTYnl91Pz6kEAa8ZA48wjsChrono.TimeStampgetCurrentTimeNanoseconds unTimeStamp TimeStamp*prettyprinter-1.7.0-L9BUdCzYor7LBsek1iasxdPrettyprinter.InternalDocPrettyprinter.Symbols.Asciicommarbracelbracerbracketlbracketrparenlparendquotesquote unAnnotateannotateenclose punctuatefillCatvcathcatsepfillSepvsephsep concatWith<+>indenthangflatAltgrouphardline softline'softlineline'linenestemptyDocprettyPretty.safe-exceptions-0.1.7.1-2h3LfH2MxVnLS7s0mmO2TmControl.Exception.Safefinallybracketcatch impureThrowthrowVersionprojectNameFromprojectSynopsisFromversionNumberFrom$fIsStringVersion $fShowVersion$fLiftLiftedRepVersionInvalidCommandLine InvalidOption UnknownOptionMissingArgumentUnexpectedArgumentsUnknownCommandNoCommandFound HelpRequestVersionRequest ParameterscommandNameFromparameterValuesFromenvironmentValuesFromParameterValueValueEmptyOptionsOptionArgumentVariableCommandsGlobalCommandConfigLongName Description ShortNameblankcomplexbaselineOptionsparseCommandLineextractValidEnvironments buildUsage buildVersion$fTextualLongName$fPrettyLongName $fKeyLongName$fIsStringParameterValue$fExceptionInvalidCommandLine$fShowInvalidCommandLine$fEqInvalidCommandLine$fShowParameters$fEqParameters$fShowParameterValue$fEqParameterValue$fShowLongName$fIsStringLongName $fEqLongName$fHashableLongName $fOrdLongName VerbosityOutputEventDebugContextisNone unProgram getContext subProgram putMessagewritewriteSwriteReventdebugdebugSdebugRThread terminategetVerbosityLevelsetProgramNamegetProgramNamegetConsoleWidthretrieveupdate outputEntireoutput inputEntireinputunThreadforksleeplookupArgumentlookupOptionValuelookupOptionFlaginvalid withContext waitForChangeghc-prim GHC.TypesIO GHC.MaybeNothingJust(core-text-0.3.0.0-Ls3gYizrdgXHrkM4OpmRLfCore.Text.UtilitiesquoteGHC.BasememptyMonoid fmapContextMessageprogramNameFrom versionFromcommandLineFromexitSemaphoreFrom startTimeFromterminalWidthFromverbosityLevelFromoutputChannelFromloggerChannelFromapplicationDataFromsetupSignalHandlersGHC.ShowshowprintrenderShow"async-2.2.2-KekkAJkpoh6Az2hBaGvAEhControl.Concurrent.AsyncAsyncCore.Text.RopeintoRopeasync GHC.Conc.IO threadDelay(core-data-0.2.1.9-4kFuERc2Wiv5vhTApAkrRCCore.Data.StructuresMaplookupKeyValuereturn