!ha      None 3689;=FT madlangHState monad providing context, i.e. function we've already called beforemadlang.datatype for a token returning a random stringmadlang$Pretoken, aka token as first read inmadlang dataype for a key aka token namemadlang0datatype for a double representing a probabilitymadlangMake 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")])madlang@Compare inside the state monad using only the underlying objects  !"#None<QVmadlangDatatype for a semantic error$madlang5Throw custom error given by string, within the parser%madlangThrow  error within parser&madlang-Throws error when a function is defined twice'madlangConstant to start s(madlang Convert a Text to a ) for use with a pretty-printer*madlang*big semantics checker that sequences stuff+madlangfTake the head of the list, or throw the appropriate error given which functions we are trying to call.,madlang9Access argument, or throw error if the list is too short.-madlang'checker to verify there is at most one :return or  :define key statement.madlang Checks that we have at most one  `:return` template in the file/madlang+Checks that there are no instances of a key0madlangDerived via our show instance;1madlang display a ! nicely with coloration & whatnot  2*+3,Noney madlangDraw as a syntax Tree4madlangFunction to transform a 7 into a `Tree String` so that it can be pretty-printed. tokToTree 1.0 tok None;= 5madlangDrop file Extension madlang"Get directory associated to a file6madlang1Function to apply a value on both arguments, e.g. between .$ (char '"')7madlang0Normalize pre-tokens/corresponding probabilities8madlang-Helper function for creating a cdf from a pdf9madlangShow as a T.Text:madlangPretty-print a ParseError;madlangStrip a pre-token's name<madlangRead a file in as a Text 5 6789:;=<None%madlang 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 >madlang5Helper function to compute the cdf when we have a pdfNone.< ?madlang(A map with all the modifiers for Madlang@madlangJumble the words in a stringAmadlangStrip file extensionBmadlangGet the :return valueCmadlang(Convert the stuff after the number to a Dmadlang5Build token in tree structure, without concatenating.Emadlang2Build the token without concatenating, yielding a # suitable to be printed as a tree.Fmadlang+Given keys naming the tokens, and lists of  , build our GmadlangPSort the keys that we have parsed so that dependencies are in the correct placesHmadlang.Ordering on the keys to account for dependency?@ABEFGNoneI Imadlang0Parse a lexeme, aka deal with whitespace nicely.Jmadlang*space consumer with awareness for commentsKmadlang6parse a symbol, i.e. string plus surrouding whitespaceLmadlangParse a number/probabilityMmadlangParse an integerNmadlang-Make sure definition blocks start un-indentedOmadlang0Make contents of definition blocks are indented.PmadlangParse between quotesQmadlangParse a keywordRmadlang Parse a varSmadlang Parse the S keyword.Tmadlang Parse the U keyword.Vmadlang Parse the V keyword.Wmadlang Parse the  `:return` keyword.Xmadlang&Parse a template name (what follows a  `:define` or Y block)ZmadlangParse a modifier[madlangParse template into a  of referents and strings\madlang*Parse a probability/corresponding template]madlangParse a function name for a  `:category` block.^madlang Parse an V_madlangParse a S blockUmadlangParse a U block`madlangParse a  `:library` declarationamadlang Parse the  `:return` blockbmadlangParse the program in terms of  and the s to link them.madlangQParse text as a token + context (aka a reader monad with all the other functions)cmadlangParse text as token + contextdmadlang!Parse text as a list of functionsemadlang@Parse text as a list of tokens, suitable for printing as a tree.madlangParse text given a context }import qualified Data.Text.IO as TIO getParsed = do f <- TIO.readFile "template.mad" parseTok "filename.mad" [] [] fmadlang8Parse text as a token, suitable for printing as a tree..fmadlangParse inclusionsmadlang!File name to use for parse errorsmadlang2Context, i.e. other random data paired with a key.madlang1list of variables to substitute into the templatemadlangActaul text to parsemadlangResultdeghf NoneV madlangParse a template file into the  data typeimadlang'Generate text from file with inclusionsmadlangKCache the parsed strucutre (and libraries it depends on) as a binary file `.filename.mbc`(, reading instead from it when possible.madlang:Generate randomized text from a file containing a templatejmadlangRun n times.kmadlangRun in the appropriate foldermadlang-Run based on text input, with nothing linked.lmadlangGet file as contextmadlangBParse a template into a RandTok suitable to be displayed as a treemadlang)variables to substitute into the templatemadlangfoldermadlangfilepath within foldermadlangparsed madlang1List of variables to substitute into the templatemadlangPath to .mad file.madlangResultm None`madlangn 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 n or in spliced expressions.omadlang Convert a p] containing to a `Q Exp` with the parsed syntax tree. Embedded code can contain inclusions.qmadlang_Turn a parse error into an error that will be caught when Template Haskell compiles at runtime.madlangSplice for embedding a '.mad' file, e.g. >demo :: IO T.Text demo = run $(madFile "twitter-bot.mad") %Embedded code can contain inclusions.None`   r       ! " # $%&'()*+%,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv w x y z {|}~ ef 'madlang-4.0.2.13-FblirsgFMvwFkTAiWDTZCS Text.MadlibsText.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.THContextRandTokListValueKey SemanticErrorNoReturnCircularFunctionCallsInsufficientArgsDoubleDefinition NoContextImportNotFound displayTreegetDirrun parseTokMparseTok parseTree parseFile cacheFilerunFilerunFileNrunTextmakeTreemadlangmadFilePreTokProb$fMonoidRandTok $fEqStateTRandTokFValueFListFNameapply customErrornoReturndoubleDefinition semErrStarttext'-ansi-wl-pprint-0.6.8.2-6AdIxh22sHDEM4okAgCrQl%Text.PrettyPrint.ANSI.Leijen.InternalDoccheckSemanticshead'accesscheckKeysingleInstance noInstance$fExceptionSemanticError$fShowSemanticErrorParser headNoReturn tokToTree dropExtension.$ normalizecdfshow'errorBundlePretty'unTok readFile' readLibFilemkCdf modifierListjumblestrip takeTemplate concatTokbuildTok buildTreebuildsortKeys orderKeyslexeme spaceConsumersymbolfloatinteger nonIndented indentGuardquotekeywordvardefinecatcategoryincludemainnamebaseGHC.BasereturnmodifierpreStrpairfunction inclusions definition preLibraryfinalprogram parseTreeM parseTokF parseTreeFparseInclusionsparseTokInternalparseTokFInternalgetInclusionCtx runInFolderN runInFolderparseCtxpathSeptemplate-haskellLanguage.Haskell.TH.Quote QuasiQuotertextToExpressionStringerrorgen