Îõ³h$s¤nþ±      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯° None  ;<=>?  ?><=;Nonel 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 D8 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 @5 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Îî6ÆH 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 case5 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). Ï () ³# 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 V6, 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 ÁÂÔÙma¯ 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 nG° 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.°°NoneniÞ@BCADHPONMLKIJQRUSTVWXY\Z[]^_`abcdefghijkl}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°Ò !" #$ %& %' () !* !+ ,- ./ .0 .1 .2 34 35 36 37 38 9: .;<=><=?<=@<=@ABCADEADFADGADHADIADJADKADLADMABNABOABPABQABRABSABTABUABVABWABXABYABZAB[AB\AB]AB^AB_AB`ABaABbABcABdABeABfABghijhikhilhimhinopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽŽ‘ ’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«  ¬­®¯° ±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐ ÑÒÓÔ ÕÖ ÕרÙÚ ÛÜ ÛÝÞß߬àáâãäåæçèéê ëì (íØÙî ëïØÙðñòØóô õö Û÷øùúøùûü*core-program-0.2.7.1-1yuBJ2fz9YpSmhJQAERx1Core.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 Control.MonadmapM_mapM 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-8xE6Va94WU9mydCQTeCt3Chrono.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 inputEntireinputunThread forkThreadfork resetTimersleep waitThread waitThread_lookupArgumentlookupOptionValuelookupOptionFlaginvalid withContext waitForChangeghc-prim GHC.TypesIO GHC.MaybeNothingJust(core-text-0.3.0.0-DPUVk4HHHKeAVUBsVFUCIACore.Text.UtilitiesquoteGHC.BasememptyMonoid fmapContextMessageprogramNameFrom versionFromcommandLineFromexitSemaphoreFrom startTimeFromterminalWidthFromverbosityLevelFromoutputChannelFromloggerChannelFromapplicationDataFromsetupSignalHandlersGHC.ShowshowprintrenderShow"async-2.2.3-6r4rKdZoy7p7xVQdBfaRvvControl.Concurrent.AsyncAsyncCore.Text.RopeintoRope GHC.Conc.IO threadDelayreturn(core-data-0.2.1.9-3woJSaJiWSr6KXDu9i7ASnCore.Data.StructuresMaplookupKeyValue