h*     0.1.0.2 Safe-Inferredpollock!Helper for using the GHC 9.10 apipollockShim for using the GHC 9.8+ apipollockShim for using the GHC 9.8+ api, note the previous name was somewhat confusing as it does result in a list not a map!pollockCompatability helper to let us get at the deprecated and warning messages consistentlypollockSimple helper used above but definable consistently across GHC versions.pollock>Helper to convert from UniqMap to Map in a consistent fashion.pollockA Helper to keep the interface clean avoiding any potential conflicts with insert. !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|(c) Trevis Elser 2023MITtrevis@flipstone.com experimentalportable Safe-Inferredo}pollockA simplified model for haddock documentation. Note this diverges from haddock itself as many of the complexities, particularly around display, are not needed for this use case.}~(c) Trevis Elser 2023MITtrevis@flipstone.com experimentalportable Safe-InferredLpollock'This is not a monoidal append, it uses  for the .(c) Trevis Elser 2023MITtrevis@flipstone.com experimental Safe-Inferred(c) Trevis Elser 2023MITtrevis@flipstone.com experimental non-portable Safe-Inferredpollock7Arguments are indexed by Int, zero-based from the left.pollockRepresent the documentation for a declaration, optionally including a warning as well as any function arguments.(c) Trevis Elser 2023MITtrevis@flipstone.com experimentalportable Safe-Inferredw  (c) Trevis Elser 2023MITtrevis@flipstone.com experimental non-portable Safe-InferredpollockProperty parser..snd <$> parseOnly property "prop> hello world"!Right (DocProperty "hello world")pollockParagraph level codeblock. Anything between the two delimiting @ is parsed for markup. (c) Trevis Elser 2023MITtrevis@flipstone.com experimental non-portable Safe-Inferred O.}~ (c) Trevis Elser 2023MITtrevis@flipstone.com experimental Safe-Inferred pollock$A helper suitable for use to set as  driverPlugin that ensures the Haddock option is set to allow other funcationality provided here to work. (c) Trevis Elser 2023MITtrevis@flipstone.com experimental not-portable Safe-Inferredpollock7The below is a small parser framework how we read keys.7all fields in the header are optional and have the form spaces1[field name][spaces] ":"text"n" ([spaces2][space][text]"n" | [spaces]"n")* where each [spaces2] should have [spaces1] as a prefix.Thus for the key  Description, Description : this is a rather long description The module comment starts herethe value will be "this is a .. description" and the rest will begin at "The module comment". is a  carrying its column.This let us make an indentation-aware parser, as we know current indentation. by looking at the next character in the stream ().Thus we can munch all spaces but only not-spaces which are indented.pollock3The description field of the Haddock module header.pollock1The copyright field of the Haddock module header.pollock/The license field of the Haddock module header.pollock2The maintainer field of the Haddock module header.pollock1The stability field of the Haddock module header.pollock3The portability field of the Haddock module header.  (c) Trevis Elser 2023MITtrevis@flipstone.com experimentalportable Safe-InferredK pollockThe haddock module header pollock?How many exported items that could have documentation attached. pollock6How many exported items that do have haddock attached.pollock0How many exported items have a since annotation.pollockHow many exported items have a code block included in the documentation.pollockHow many exported items have an example included in the documentation.pollockHow many exported items have a property included in the documentation.pollock8How many exported items have a warning attached to them. (c) Trevis Elser 2023MITtrevis@flipstone.com experimental Safe-Inferred (c) Trevis Elser 2023MITtrevis@flipstone.com experimental Safe-InferredfpollockCreate  by looping through the declarations. For each declaration, find its names, its subordinates, and its doc strings. Process doc strings into }s.pollockUnions together two  ArgDocMaps (or ArgMaps in haddock-api), such that two maps with values for the same key merge the inner map as well. Left biased so unionArgMaps a b prefers a over b.pollockBuild the list of items that will become the documentation, from the export list. At this point, the list of ExportItems is in terms of original names.We create the export items even if the module is hidden, since they might be useful when creating the export items for other modules.pollock(Lookup docs for a declaration from maps.pollockTemplate Haskell putDoc docs(c) Trevis Elser 2023MITtrevis@flipstone.com experimental Safe-Inferred                     !"#$%&'()*+,-.,-/,-0,-1,-2,-3,-4,-5,-6,-7,-8,9:,9;,<=,>?,@A,BC,BD,EF,EG,EH,EI,EJ,EK,EL,EM,NO,NP,QR,QS,TU,9V,TW,XY,Z[,\],^_,\`,\a,\b,\c,\d,\e,\f,\g,\h,\i,\i,jk,lm,no,lp,9q,rs,rs,rt,ru,rv,rw,xy,xz,x{,x|,x},x~,x,x,x,x,x,x,n,n,Q,Q,Q,\,\,\,Q,,,,,Q,9,Q,,,,,,,,)         &pollock-0.1.0.2-3ArbBelxS99EsA4SCSKASGPollockpollockPollock.CompatGHCPollock.Documentation.DocPollock.Documentation.Metadata$Pollock.Documentation.MetadataAndDoc*Pollock.Documentation.DocumentationForDecl Pollock.Documentation.ExportItemPollock.Documentation.ParserPollock.DocumentationPollock.DriverPluginPollock.ModuleInfo.ModuleHeaderPollock.ModuleInfo.ModuleInfoPollock.ModuleInfoPollock.ProcessModuleensureHaddockIsOn ModuleHeader description copyrightlicense maintainer stability portability ModuleInfo moduleHeaderhaddockableExportshaddockedExports numWithSincenumWithCodeBlocknumWithExamplenumWithPropertynumWithWarning processModule getHeaderInfoavailSubordinateNamesnonDetUniqMapToListmapWarningTxtMsg lookupOccnonDetEltUniqMapToMap insertEnumSetbase GHC.IORef readIORefghc GHC.Tc.TypesTcGblEnv tcg_exports tcg_insts tcg_fam_insts tcg_warns tcg_th_docstcg_semantic_mod tcg_rdr_envtcg_rn_imports tcg_rn_declstcg_rn_exportsGHC.Types.Name getSrcSpannameIsLocalOrFromGHC.Types.Name.Occurrence emptyOccEnvGHC.Types.Name.Env lookupNameEnvGHC.Types.Name.Reader GlobalRdrEnvGHC.Unit.Module.WarningsWarnings WarningTxtGHC.HsToCore.Docs declTypeDocs extractTHDocs getInstLocgetMainDeclBinderisValD nubByName subordinatestopDeclsGHC.Driver.SessionDynFlags generalFlagsGHC.Types.SrcLoc GenLocatedLGHC.Hs.DocString HsDocStringNamerenderHsDocStringGHC.Hs.ExtensionGhcRn!Language.Haskell.Syntax.ExtensionIdPLanguage.Haskell.Syntax.DeclsLHsDeclGHC.Unit.TypesModuleHsDeclInstDDerivDValDSigDDocD feqn_tyconInstDecl TyFamInstD TyFamInstDecl#Language.Haskell.Syntax.Module.Name ModuleNameGHC.Parser.Annotation SrcSpanAnnA GHC.Hs.UtilscollectHsBindBindersgetLocA nameModule GHC.Hs.DocExtractedTHDocsethd_mod_headerHsDocWithHsDocIdentifiers hsDocStringLanguage.Haskell.Syntax.ImpExpIEIEModuleContentsIEGroupIEDoc IEDocNamed ImportDecl ideclNameideclAsideclImportListImportListInterpretationExactly EverythingBut CollectFlagCollNoDictBinders RealSrcSpanSrcSpanDocDeclDocCommentNamedDocGroupLocatedGHC.Driver.Env.TypesHscEnv hsc_dflagsGHC.Driver.Flags GeneralFlag Opt_Haddock lookupSrcSpangetNameunLocGHC.Types.Avail AvailInfoAvailsavailExportsDecl availName availNamesavailsToNameEnv nubAvailsGHC.Types.SourceText StringLiteralprocessWarnSomestringLiteralToStringDocDocEmpty DocCodeBlock DocParagraph DocProperty DocString DocAppend DocWarning DocExamples docAppendExampleexampleExpression exampleResult docHasWarningdocHasCodeBlockdocHasPropertydocHasExamples metaAppendGHC.Base<|>versionMetadata emptyMetadatametadataHasSinceVersion MetaAndDocdocmetawithEmptyMetadatametaAndDocConcatmetaAndDocAppend FnArgsDocDocumentationForDecldocumentationDocdocumentationWarningdocumentationFunctionArgDoc ExportItemExportItemDecl ExportItemDoc mkExportDoc ExportDecl expItemMbDocexportItemHasSinceVersionexportItemHasCodeBlockexportItemHasExampleexportItemHasPropertyexportItemHasWarningproperty codeblockprocessDocStringParasprocessDocStrings parseTextCghc-prim GHC.TypesCharcurIndprocessModuleHeaderbuildModuleInfomkMapsMaps unionArgMaps mkExportItems lookupDocs