Aml     NoneHMParse a string as an  or a O, apply the given generic transformation to it, and re-render it back to text.'Render haskell code in a compact formatNone. !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIbJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=?@ABCEFG  !"#&%$'+*)(,.-/0123456789:;<=>?@ABCDEFGHINoneFNoneFExpression with syntactic sugar' None3FDoes a name occur in a pattern?:How often does the given name occur free in an expression?(Does a name occur free in an expression?"The subset of ds that d depends onCConvert recursive lets to lambdas with tuple patterns and fix calls3Rename all variables to (locally) unqiue fresh ones^It's a pity we still need that for the pointless transformation. Otherwise a newly created idconst\... could be bound by a lambda e.g. transform' (id x -> x) ==> transform' (id -> id) ==> idMake an expression points free_Transform patterns to: fst/snd for tuple patterns head/tail for cons patterns idconstflip/. for variable paterns  NoneExpressions with holes No MLambda here because we only consider closed Terms (no alpha-renaming!). Has to be in this module, otherwise we get recursion/Hole/argument where another expression could go Application<<9 None24FM,An expression with holes to match or replaceExpression with holesNumber of holes%Apply the rule only in the first pass=Apply the second rule only if the first rule has some results;Optionally apply the rewrite rule, Opt x == Or [identity,x]9Apply the first rule, apply the second rule to the result3Try the first rule, if it fails use the second rule Use all ruleswApply the first rule, then try the second rule on the first result if it fails, returns the result of the first rule&Like Up, but applied to subexpressions5Haskell function as a rule, applied to subexpressions A * rule, rewrite the first to the second s can contain s Fill in the holes in a  %Create an array, only if the keys in lst+ are unique and all keys [0..n-1] are given eTry to match a Rewrite to an expression, if there is a match, returns the expressions in the holes Fill in the holes in a FMatch an Expr to a MExpr template, return the values used in the holesYet another pointless transformation: Bring an MExpr to (more pointless) form by seeing it as a function hole_n -> ... and writing that in pointless form%Is there a (Hole n) in an expression?7Variants of a rewrite rule: fill in (some of) the holes2haddock doesn't like n+k patterns, so rewrite them7Variants of a rewrite rule: fill in (some of) the holes2haddock doesn't like n+k patterns, so rewrite them_Use this rewrite rule and rewrite rules derived from it by iterated pointless transformation Construct a   rewrite rule Construct a   rewrite rule Construct a   rewrite rule Construct a   rewrite ruleApply Down/Up repeatedlyApply Down/Up repeatedly'      !"#         !"# None:FHM$%&'()*+,-./01234567   1$%&'()*+,-./01234567 None2348The size" of an expression, lower is bettervThis seems to be a better size for our purposes, despite being "a little" slower because of the wasteful uglyprinting9Optimize an expression:Apply all rewrite rules once;Apply a single rewrite rule<.Apply a rewrite rule to an expression in a deep, position, i.e. from inside a RR,CRR or Down =>?89:;@<9 =>?89:;@<  Safe-InferredAABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{| ABCDFEG0wvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHxyz{|}~  Safe-InferredD  Safe-Inferred  Safe-Inferred Safe-Inferred Safe-Inferred      !"      !"      !";Don Stewart, Lennart Kolmodin 2007, Twan van Laarhoven 2008GPL-style (see LICENSE)None#$%&'()*+,-./0123456789:;<=#$%&'()*+,-./0123456789:;<=13None>>] is a smart constructor that inserts parens when the first argument is an infix application. ?@ABCDEFG> ?@ABCDEFG>NoneHIJHIJNoneKcalculates "desired" indentation and return pretty-printed declarations the indentation calculations are still pretty much rough guesswork. i'll have to figure out a way to do some _reliable_ pretty-printing!LMKLMKNoneNOPQRSTUVWXYZ[\]^_`abNOPQRSTUVWXYZ[\]^_`abN Nonec"Convert a string to pointfree form defghcij defghcijNoneklmnklmnNone!"+&opqrstuvwxyz{|}~       opqrstuvwxyz{|}~     None3F,We can accumulate an interesting environmentExtract the default environmentCall the binary:NoneNoneNoneActually run the hoogle binaryNoneNice little combinator used to throw away error messages from an Either and just keep a Maybe indicating the success of the computation.-Parse an instance declaration. Sample inputs: Linstance Monad [] instance (Monoid w) => Monad (Writer w) instance (State s) Wrapper for the instance parser.nSplit the input into a list of the instances, then run each instance through the parser. Collect successes.)The standard modules we ask GHCi to load.Main processing function for @instances. Takes a class name and return a list of lines to output (which will actually only be one).Main processing function for @instances-importing. Takes the args, which are words'd. The all but the last argument are taken to be the modules to import, and the last is the typeclass whose instances we want to print.XInterface with GHCi to get the input for the parser, then send it through the parser.  NoneFNoneNone    !"#$%&'()*+,-./0123456789:;9:<=>?@<ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmklnkloklpklqklrkstksukvwkvxkvyklzkl{kv|kv}ks~kskskskkkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkk      !"#$%&'()*+,-./0123456789:;<=>?@ABCD%EFGHIJ K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h h i j k l m n o p q r s t u v w x y z { | } ~                                  4            t                HM  L    !"#$%&'())*+,-./00123456789:;<=>?@ABBCDEFGHIJKLMNOPQRSTUVWXYZ[Y\]^_`abcdefghijkl<mnopqrs`tuvwxyz{|}~<Slambdabot-haskell-plugins-5.0Lambdabot.Plugin.HaskellLambdabot.Util.Parser"Lambdabot.Plugin.Haskell.Pl.Common"Lambdabot.Plugin.Haskell.Pl.Parser)Lambdabot.Plugin.Haskell.Pl.PrettyPrinter%Lambdabot.Plugin.Haskell.Pl.Transform!Lambdabot.Plugin.Haskell.Pl.Names#Lambdabot.Plugin.Haskell.Pl.RuleLib!Lambdabot.Plugin.Haskell.Pl.Rules$Lambdabot.Plugin.Haskell.Pl.Optimize#Lambdabot.Plugin.Haskell.Free.Parse"Lambdabot.Plugin.Haskell.Free.Util"Lambdabot.Plugin.Haskell.Free.Type"Lambdabot.Plugin.Haskell.Free.Expr%Lambdabot.Plugin.Haskell.Free.Theorem)Lambdabot.Plugin.Haskell.Free.FreeTheoremLambdabot.Plugin.Haskell.UnMtlLambdabot.Plugin.Haskell.UndoLambdabot.Plugin.Haskell.SourceLambdabot.Plugin.Haskell.Pretty!Lambdabot.Plugin.Haskell.PointfulLambdabot.Plugin.Haskell.Pl Lambdabot.Plugin.Haskell.HaddockLambdabot.Config.HaskellLambdabot.Plugin.Haskell.DjinnLambdabot.Plugin.Haskell.EvalLambdabot.Plugin.Haskell.CheckLambdabot.Plugin.Haskell.Hoogle"Lambdabot.Plugin.Haskell.InstancesLambdabot.Plugin.Haskell.TypeLambdabot.Plugin.Haskell.Free unmtlPlugin undoPlugin sourcePlugin prettyPluginpointfulPluginplPlugin haddockPlugin evalPrefixestrustedPackages languageExts djinnBinary ghcBinary ghciBinary hoogleBinary muevalBinarymaxPasteLength djinnPlugin evalPlugin checkPlugin hooglePlugininstancesPlugin typePlugin freePluginhaskellPlugins withParsedhaskell-src-exts-1.16.0.1Language.Haskell.Exts.SyntaxExpDeclprettyPrintInLineTopLevelTLETLDDefinedeclNamedeclExprPatternPTuplePConsPVarExprLetAppLambdaVarFixityInfPref mapTopLevelgetExprsizeExprcompflip'id'const'scombconsnilfix'if'makeListgetListbtshiftmaxPrecminPrec operatorsopchars reservedOpsopFMlookupOp lookupFixreadM $fOrdFixity $fEqFixitybaseGHC.Baseassertfail>>=>>fmapreturn Control.Arrowfirst||| Control.MonadguardliftMjoinMonadFunctor MonadPlusfoldM***&&&second+++ Data.List minimumBy interspersemfilterapliftM5liftM4liftM3liftM2unlesswhen replicateM_ replicateMfoldM_ zipWithM_zipWithM mapAndUnzipMvoidforever<=<>=>msumforM_forMfilterMmapM_mapM sequence_sequence=<<mplusmzero Data.MaybefromJustisJust parsec-3.1.8Text.Parsec.Expr AssocNone AssocLeft AssocRightAssoctpparensbracketssymbol modIdentifieratomicreserved charLiteral stringLiteraltableparseOppatternlambdavarlisttuple unaryNegation rightSectionmyParserexprdeclletbindifexprterm applicationendsIninputparsePF postprocessSExprEnumTupleList RightSection LeftSectionSInfixSAppSLetSLambdaSVar toSExprHeadtoSExprgetHead isOperator getInfName getPrefName $fEqAssoc $fShowPattern $fShowSExpr $fShowExpr$fShowTopLevel $fShowDecloccursPfreeInisFreeIn dependsOnunLet alphaRename transform transform'EnvtuplePMExprHoleMAppQuoteidEflipEconstEcompEsEfixEbindEextEreturnEconsEnilEappendEfoldrEfoldlEfstEsndEdollarEuncurryEcurryEheadEtailEcommaEfoldl1EequalsEnequalsEnotEplusEmultEzeroEoneElengthEsumEproductEconcatE concatMapEjoinEmapEfmapEfmapIE subtractEminusEliftMEliftM2EapEseqMEzipEzipWithEcrossEfirstEsecondEandEorEallEanyEacRewriteholesridHardIfOptThenOrElseOrUpDownCRRRRmyFire uniqueArraymatchfire' matchWith transformMhasHole getVariants' getVariantsrrListrrrr1rr2rr0downupExprArrRewriteC getRewrite RewriteRulenub'fire fromMExpr$fRewriteC(->)$fRewriteCMExprUnaryUABinaryBA collapseLists evalBinary evalUnaryassocRassocLassoc commutative simplifies onceRewritesrules assocLOps assocROpsassocOpscommutativeOps unaryBuiltinsbinaryBuiltins sizeExpr'optimizesteprewriterewSizecut toMonadPlusrewDeepParseSparse ParseResult ParseError ParseSuccessTokenTokErrorIdUscoreIdWhereIdTypeIdThenIdOf IdNewtypeIdModuleIdLet IdInstanceIdInfixrIdInfixlIdInfixIdInIdImportIdIfIdForallIdElseIdDo IdDeriving IdDefaultIdDataIdClassIdCase OpImpliesOpTildeOpAtOpArrow OpBackArrowOpPipe OpBackslashOpEquals OpColonColonOpColonOpDotDot CloseBrace OpenBrace BackQuote CloseBracket OpenBracket SemicolonComma CloseParen OpenParenQConSymQVarSymQConIdQVarId peekTokengetToken ascSymbollexer$fMonadPlusParseS$fAlternativeParseS $fMonadParseS$fApplicativeParseS$fFunctorParseSPrettyprettyPpretty prettyParenprettyParenIndentpretty-1.1.1.1Text.PrettyPrint.HughesPJMode OneLineModeLeftMode ZigZagModePageModeStylemode lineLengthribbonsPerLinestyle fullRender renderStylerenderfsepfcatcatsep<+><>$+$$$ punctuatehangnestvcathsephcat reduceDocbraces doubleQuotesquotesrationaldoublefloatintegerintrbracelbracerbracklbrackrparenlparenequalsspacecoloncommasemiisEmptyempty zeroWidthText sizedTextptexttextcharDocChrStrPStr TextDetailsTypeTyVarTyConsTyTupleTyArrTyForallTyName precTYAPP precARROWprettyTs parseType parseType' normaliseTypereadType $fPrettyTypeExprCtxECTyAppECAppRECAppLECDotBuiltinBArr BMapTupleBProjBIdBMapETyAppEAppEVarOpEBuiltinEVarFRFNFL varInExpr leftVarOfExpr exprSubstapplySimplifierExpr unzipExprvarInCtxprecAPP$fPrettyBuiltin $fPrettyExprTheoremThAndThEqual ThImpliesThForall precIMPLIESprecAND prettyTheorem prettyForall varInTheoremapplySimplifierTheorempeepholeSimplifyTheorempeepholeSimplifyTheorem'peepholeSimplifyExprpeepholeSimplifyExpr' foldEquality tryCurryingtheoremSimplify theoremSubst$fPrettyTheoremRNRnStgammaunique uniquelistuniquefnTyEnvMyMonMyState myVSupplymakeVar extractTypesfreeTheoremStr freeTheoreminitRnSt freshNamefreshFunctionName freshListNameinsertRnlookupRnrenamernExprnTy freeTheorem'PPTypePMonadpResultpErrorpFunlift0lift1lift2lift3lift4lift5mkPfun-->cuconforall_types mtlParser mtlParser' $fMonadPMonad$fApplicativePMonad$fFunctorPMonadappfindVarundo irrefutableinfixedpvardo'fetchhelpStrdoPretty prettyCmdextT'unkLoc stabilizenamesInpVarsInsuccName succAlpha optimizeD optimizeRhs optimizeEfreshuncomb' combinatorsrecognizedNamescombinatorModule uncombOnceuncomb optimizeOncepointfulpfPlPlState firstTimeout maxTimeoutresoptimizeTopLevel optimizeIOHaddock HaddockState doHaddockstripPs EVALPREFIXESTRUSTEDPACKAGES LANGUAGEEXTS DJINNBINARY GHCBINARY GHCIBINARY HOOGLEBINARY MUEVALBINARYMAXPASTELENGTH trustedPkgs$fGEq*EVALPREFIXES defaultExts$fGEq*TRUSTEDPACKAGES$fGEq*LANGUAGEEXTS$fGEq*DJINNBINARY$fGEq*GHCBINARY$fGEq*GHCIBINARY$fGEq*HOOGLEBINARY$fGEq*MUEVALBINARY$fGEq*MAXPASTELENGTHDjinnEnv getDjinnEnvdjinnDjinn getSavedEnv getUserEnv rejectingCmdsdjinnCmd djinnAddCmd djinnEnvCmd djinnNamesCmd djinnClrCmd djinnDelCmd djinnVerCmdgetDjinnVersiontryDjinnclean_argsisEval dropPrefixrunGHCdefine mergeModulesmoduleProblemsmungemungeEncdefineFromLPaste fetchLPasteresetcheck postProcesshooglecutoff eitherToMaybe instanceP parseInstance getInstancesstdMdlsfetchInstancesfetchInstancesImportingfetchInstances' ModuleName ClassNameInstancerunit theCommandsignature_regex stripCommentsgoextract_signatures query_ghci