b\V      Safe2579;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 name0datatype for a double representing a probability@Compare inside the state monad using only the underlying objectsMake O 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")])   None2579; Drop file Extension"Get directory associated to a file1Function to apply a value on both arguments, e.g. between .$ (char '"') 0Normalize pre-tokens/corresponding probabilities!-Helper function for creating a cdf from a pdf"Show as a T.Text#Pretty-print a ParseError$Strip a pre-token's name%Read a file in as a Text&cAdd a PR for this? Could be useful in Megaparsec idk Allows us to use monoidal addition on parsers  !"#$%&  !"#$%  !"#$%&None257:Datatype for a semantic error'5Throw custom error given by string, within the parser(Throw  error within parser)+Throws argument for circular function calls*-Throws error when a function is defined twice+'Throws error for insufficient arguments,Constant to start s- Convert a Text to a . for use with a pretty-printer/*big semantics checker that sequences stuff0'helper to filter out stuff that doesn't1fTake the head of the list, or throw the appropriate error given which functions we are trying to call.2:Access 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 '8(9)*+,-/01234567 '8(9)*+,-/012345 '8(9)*+,-/01234567None257  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 :5Helper function to compute the cdf when we have a pdf : : :Safe257;Draw as a syntax Tree<Function to transform a 8 into a `Tree String` so that it can be pretty-printed. tokToTree 1.0 tok;<;<;<None257=Get the :return value>(Convert the stuff after the number to a ?6Build token in tree structure, without concatenating. @2Build the token without concatenating, yielding a $ suitable to be printed as a tree. A+Given keys naming the tokens, and lists of  , build our BPSort the keys that we have parsed so that dependencies are in the correct placesC.Ordering on the keys to account for dependency DEF=>?@ABC DEF=>?@ABC DEF=>?@ABCNone257G1Parse a lexeme, aka deal with whitespace nicely. H*space consumer with awareness for commentsI6parse a symbol, i.e. string plus surrouding whitespaceJParse a number/probabilityKParse an integerL-Make sure definition blocks start un-indentedM0Make contents of definition blocks are indented.NParse between quotesOParse a keywordP Parse a varQ Parse the Q keyword.R Parse the R keyword.S Parse the  `:return` keyword.T&Parse a template name (what follows a  `:define` or U block)VParse a modifierWParse template into a  of referents and stringsX*Parse a probability/corresponding templateY Parse an RZParse a Q block[ Parse the  `:return` block\Parse 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)]Parse text as token + context^!Parse text as a list of functions_@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" [] [] f`8Parse text as a token, suitable for printing as a tree..aParse inclustionsGHIJKLMNOPQRSTVWXYZ[\ ]^_ !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 parseResult`aGHIJKLMNOPQRSTVWXYZ[\ ]^_ `aGHIJKLMNOPQRSTVWXYZ[\ ]^_ `a None257: Parse a template file into the  data typeb'Generate text from file with inclusions:Generate randomized text from a file containing a templatecRun in the appropriate folder-Run based on text input, with nothing linked.dGet file as contextBParse a template into a RandTok suitable to be displayed as a tree )variables to substitute into the templatefolderfilepath within folderparsed b1List of variables to substitute into the templatePath to .mad file.Resultcd bcd bcd None257 edatatype for the subcommandsfdatatype for the programg/Parser for command-line options for the programhParser for debug subcommandiParser for the run subcommandjParser for the lint subcommandMain program actionExample Usage: -$ madlang run example.mad some text generatedkWraps parser with help parserl7given a parsed record perform the appropriate IO actionemnopqrfstughijklemnoqprfstughijkl emnopqrrfstughijkl None257v for an EDSL, e.g. xdemoQQ :: 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 v or in spliced expressions.Splice for embedding a '.mad' file, e.g. >demo :: IO T.Text demo = run $(madFile "twitter-bot.mad") 7Note that the embedded code cannot have any inclusions.wxwwxNone257     y          !"#$% &'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop q r s t u v w x y z { | } ~  u  &madlang-2.3.0.2-JAEQ2djax4uLvlni2NhWQH Text.MadlibsText.Madlibs.Internal.TypesText.Madlibs.Internal.UtilsText.Madlibs.Cata.SemErrText.Madlibs.Cata.RunText.Madlibs.Cata.DisplayText.Madlibs.Ana.ParseUtilsText.Madlibs.Ana.ParseText.Madlibs.Ana.ResolveText.Madlibs.Exec.MainText.Madlibs.Generate.THContextRandTokListValue SemanticErrorNoReturnCircularFunctionCallsInsufficientArgsDoubleDefinition NoContextrun parseTokMparseTok parseFilerunFilerunTextmakeTree runMadlangmadlangmadFilePreTokKeyProb $fEqStateT$fMonoidRandTokNameapply $fEqPreTok dropExtensiongetDir.$ normalizecdfshow'parseErrorPretty'unTok readFile'$fMonoidParsecT customErrornoReturncircularFunctionCallsdoubleDefinitioninsufficientArgs semErrStarttext',ansi-wl-pprint-0.6.7.3-EqhsHSbxOT2xFHZZJCFwfText.PrettyPrint.ANSI.LeijenDoccheckSemanticssumProbhead'accesscheckKeysingleInstance noInstance$fExceptionSemanticError$fShowSemanticErrorshowCustomError noContextmkCdf displayTree tokToTree takeTemplate concatTokbuildTok buildTreebuildsortKeys orderKeys modifierListjumblestriplexeme spaceConsumersymbolfloatinteger nonIndented indentGuardquotekeywordvardefineincludemainnamebaseGHC.BasereturnmodifierpreStrpair inclusions definitionfinalprogram parseTreeM parseTokF parseTreeF parseTreeparseInclusionsgetInclusionCtx runInFolderparseCtx SubcommandProgramordersdebugtemplintwrappertemplateDebugRunLintversionrepclInputssubinputtemplate-haskellLanguage.Haskell.TH.Quote QuasiQuotertextToExpressionerrorgen