h^`"      SafeNone345689;=FT HState monad providing context, i.e. function we've already called before.datatype for a token returning a random string $Pretoken, aka token as first read in dataype for a key aka token name!0datatype for a double representing a probability"Make N a monoid so we can append them together nicely (since they do generate text). d(Value "Hello") <> (List [(0.5," you"), (0.5, " me")]) (List [(0.5,"Hello you"), (0.5, "Hello me")])#@Compare inside the state monad using only the underlying objects  $%!&'() %$')(None<Datatype for a semantic error*5Throw custom error given by string, within the parser+Throw  error within parser,-Throws error when a function is defined twice-Constant to start s. Convert a Text to a / for use with a pretty-printer0*big semantics checker that sequences stuff1fTake the head of the list, or throw the appropriate error given which functions we are trying to call.29Access argument, or throw error if the list is too short.3'checker to verify there is at most one :return or  :define key statement4 Checks that we have at most one  `:return` template in the file5+Checks that there are no instances of a key6Derived via our show instance;7 display a ! nicely with coloration & whatnot  80192 Nonef:Draw as a syntax Tree;Function to transform a 7 into a `Tree String` so that it can be pretty-printed. tokToTree 1.0 tok:None;= <Drop file Extension="Get directory associated to a file>1Function to apply a value on both arguments, e.g. between .$ (char '"')?0Normalize pre-tokens/corresponding probabilities@-Helper function for creating a cdf from a pdfAShow as a T.TextBPretty-print a ParseErrorCStrip a pre-token's nameDRead a file in as a Text <=>?@ABCEDNone#z  Generate randomized text from a  getText :: IO T.Text getText = do let exampleTok = List [(1.0,List [(0.5,Value "heads"),(0.5,Value "tails")])] run exampleTok ,Same thing, but uses a catamorphism (slower)F5Helper function to compute the cdf when we have a pdfGAAnother helper function, this time for use with our catamorphism. None+ H(A map with all the modifiers for MadlangIJumble the words in a stringJStrip file extensionKGet the :return valueL(Convert the stuff after the number to a M5Build token in tree structure, without concatenating.N2Build the token without concatenating, yielding a # suitable to be printed as a tree.O+Given keys naming the tokens, and lists of   , build our PPSort the keys that we have parsed so that dependencies are in the correct placesQ.Ordering on the keys to account for dependencyHIJKNOP NoneB R0Parse a lexeme, aka deal with whitespace nicely.S*space consumer with awareness for commentsT6parse a symbol, i.e. string plus surrouding whitespaceUParse a number/probabilityVParse an integerW-Make sure definition blocks start un-indentedX0Make contents of definition blocks are indented.YParse between quotesZParse a keyword[ Parse a var\ Parse the \ keyword.] Parse the ^ keyword._ Parse the _ keyword.` Parse the  `:return` keyword.a&Parse a template name (what follows a  `:define` or b block)cParse a modifierdParse template into a   of referents and stringse*Parse a probability/corresponding templatefParse a function name for a  `:category` block.g Parse an _hParse a \ block^Parse a ^ blockiParse a  `:library` declarationj Parse the  `:return` blockkParse the program in terms of   and the s to link them.QParse text as a token + context (aka a reader monad with all the other functions)lParse text as token + contextm!Parse text as a list of functionsn@Parse text as a list of tokens, suitable for printing as a tree.Parse text given a context }import qualified Data.Text.IO as TIO getParsed = do f <- TIO.readFile "template.mad" parseTok "filename.mad" [] [] f8Parse text as a token, suitable for printing as a tree..oParse inclusions!File name to use for parse errors2Context, i.e. other random data paired with a key.1list of variables to substitute into the templateActaul text to parseResultmnpqo None<M Parse a template file into the  data typer'Generate text from file with inclusionssKCache the parsed strucutre (and libraries it depends on) as a binary file `.filename.mbc`(, reading instead from it when possible.:Generate randomized text from a file containing a templatetRun n times.uRun in the appropriate folder-Run based on text input, with nothing linked.vGet file as contextBParse a template into a RandTok suitable to be displayed as a tree)variables to substitute into the templatefolderfilepath within folderparsed 1List of variables to substitute into the templatePath to .mad file.Resultwsx None09KWuy for an EDSL, e.g. ydemoQQ :: T.Text demoQQ = run [madlang| :define something 1.0 "hello" 1.0 "goodbye" :return 1.0 something |] nNote that this is in general much faster than running interpreted code, though inclusions do not work in the y or in spliced expressions.z Convert a {] containing to a `Q Exp` with the parsed syntax tree. Embedded code can contain inclusions.|_Turn a parse error into an error that will be caught when Template Haskell compiles at runtime.Splice for embedding a '.mad' file, e.g. >demo :: IO T.Text demo = run $(madFile "twitter-bot.mad") %Embedded code can contain inclusions. NoneX}As an example, `vmchale/some-library` would be valid input.}~ None^ datatype for the subcommandsdatatype for the program/Parser for command-line options for the programParser for the run subcommand Parser for the sample subcommandParser for the lint subcommandMain program actionExample Usage: -$ madlang run example.mad some text generatedWraps parser with help parser7given a parsed record perform the appropriate IO actionNone_\        ! " # $ %&'()*+,-./01.23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` a b c d e f g h i j k l m n o pqrs t u v w x y z { | } ~   qr           &madlang-4.0.0.3-KNldBcVJgRK58t45IJtWqe Text.Madlibs Paths_madlangText.Madlibs.Internal.TypesText.Madlibs.Cata.SemErrText.Madlibs.Cata.DisplayText.Madlibs.Internal.UtilsText.Madlibs.Cata.RunText.Madlibs.Ana.ParseUtilsText.Madlibs.Ana.ParseText.Madlibs.Ana.ResolveText.Madlibs.Generate.THText.Madlibs.Packaging.FetchText.Madlibs.Exec.MainContextRandTokListValueKey SemanticErrorNoReturnCircularFunctionCallsInsufficientArgsDoubleDefinition NoContextImportNotFoundrunrunCata parseTokMparseTok parseTree parseFilerunFilerunTextmakeTreemadlangmadFile runMadlangversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNamePreTokProb$fMonoidRandTok $fEqStateTNameapplyRandTokFValueFListF customErrornoReturndoubleDefinition semErrStarttext'-ansi-wl-pprint-0.6.8.2-HWpcNOPVvAd306GvUbpgip%Text.PrettyPrint.ANSI.Leijen.InternalDoccheckSemanticshead'accesscheckKeysingleInstance noInstance$fExceptionSemanticError$fShowSemanticErrorParser headNoReturn displayTree tokToTree dropExtensiongetDir.$ normalizecdfshow'parseErrorPretty'unTok readFile' readLibFilemkCdf mkCdfCata modifierListjumblestrip takeTemplate concatTokbuildTok buildTreebuildsortKeys orderKeyslexeme spaceConsumersymbolfloatinteger nonIndented indentGuardquotekeywordvardefinecatcategoryincludemainnamebaseGHC.BasereturnmodifierpreStrpairfunction inclusions definition preLibraryfinalprogram parseTreeM parseTokF parseTreeFparseInclusionsparseTokInternalparseTokFInternalgetInclusionCtx cacheFile runInFolderN runInFolderparseCtxpathSeprunFileNtemplate-haskellLanguage.Haskell.TH.Quote QuasiQuotertextToExpressionStringerrorgen fetchGithubinstallVimPlugin fetchPackages cleanPackages SubcommandProgramorderstempsamplelintwrappertemplateDebugRunLintSampleGetInstall VimInstallinput_repclInputs_remotesub