h*6q28      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0.0.0.2 Safe-Inferred" cabal-fixWarnings covering leftovers, s and   cabal-fix2Run a Parser, throwing away leftovers. Nothing on  or .  cabal-fix7Run a Parser, throwing away leftovers. Returns Left on  or .  cabal-fix.Run parser, returning leftovers and errors as s.  cabal-fixNote that this type does not contain any position information.The construction assumes that comments relate to fields below, so there is potential for an end comment unrelated to any particular field." cabal-fix1Note that cabal does not have multi-line comments# cabal-fix(A margin tracker for combining sections.& cabal-fixWhether the range part of the dependency list should be vertically aligned on a column.) cabal-fixWhether the value part of each field should be vertically aligned on a column., cabal-fixPolicy for Fields listed in =- cabal-fixReplace existing values. cabal-fixAppend after existing values/ cabal-fix#Add only of the Field doesn't exist0 cabal-fixInclude a trailing (or leading) comma, after the last value (or before the first value.)3 cabal-fix$The style for comma-separated values4 cabal-fixcommas before values5 cabal-fixcommas after values6 cabal-fix comma freedom7 cabal-fix'remove commas (allowed for some fields)8 cabal-fixConfiguration values for various aspects of (re)rendering a cabal file.: cabal-fix,fields that should be converted to free text; cabal-fixfields that should be removed< cabal-fixPreferred dependency ranges= cabal-fix&Add fields (Overwriting depends on an ,)> cabal-fix4Fields where CommaStyle should be checked and fixed.? cabal-fix5Fields where elements should be sorted alphabetically@ cabal-fixWhether to sort Fields.A cabal-fixThe preferred ordering of Fields if they are sorted (lower numbers are placed first).B cabal-fix)Whether to fix the build dependency FieldC cabal-fixHow to align build dependenciesD cabal-fix,Whether to remove Fields with no informationE cabal-fixWhether to column-align valuesF cabal-fixThe number of spaces between the field nameand the value, if aligned.G cabal-fixMargin between sectionsH cabal-fixMargin around commentsI cabal-fix>Shift from narrow style to multi-line beyond this column size.J cabal-fixIndentation valueK cabal-fix8An opinionated configuration for formatting cabal files.'Some opinions (that can be configured):fixCommas defaultConfig[("extra-doc-files",NoCommas,NoTrailer),("build-depends",PrefixCommas,Trailer)]4 are better for the dependency list as dependency ranges are already noisy enough without a comma thrown in. 1 (which means leading comma for prefixed commas) is neater and easier to prepend to, append to & sort.If a field list doesn't need commas, then they should be removed.preferredDeps defaultConfig[("base",">=4.14 && <5")]4Standard practice compared with the much tighter eg base ^>=4.17.2.1sortFieldLines defaultConfig["build-depends","exposed-modules","default-extensions","ghc-options","extra-doc-files","tested-with"]4Sort all the things, but especially the module list.valueAligned defaultConfigValueUnalignedAdding an extra, long-named field to the cabal file means we have to re-align all the value parts in all the other fields.depAlignment defaultConfig DepAlignedbuild-depends is so busy, however, the extra alignment becomes more important.doSortFields defaultConfigTrueWhatever the order, fields should have the same order within each section. cabal-fix An opionated ordering of fields.L cabal-fix-iso to flip between vectors and lists easily.)cf & view (#fields % fieldList') & take 2[Field (Name [] "cabal-version") [FieldLine [] "3.0"],Field (Name [] "name") [FieldLine [] "minimal"]]M cabal-fixA Prism betwixt a  and a .cf & over (#fields % fieldList') (take 2) & review (cabalFields' cfg) & C.putStrcabal-version: 3.0 name: minimalN cabal-fixA lens that doesn't descend into sections. It will lens the first-encountered named field, if any.view (topfield' "name") cf6Just (Field (Name [] "name") [FieldLine [] "minimal"])#view (topfield' "build-depends") cfNothingO cabal-fix0A lens by name into a field (but not a section).fs & view (field' "version")4[Field (Name [] "version") [FieldLine [] "0.1.0.0"]]P cabal-fix9A getter by name into a field (including within sections)3fs & toListOf (each % subfield' "default-language")[[],[],[],[],[],[],[],[],[Field (Name [] "default-language") [FieldLine [] "GHC2021"]],[Field (Name [] "default-language") [FieldLine [] "GHC2021"]]]Q cabal-fix#A getter of a section (not a field)fs & foldOf (section' "library" % each % secFields' % field' "exposed-modules"):[Field (Name [] "exposed-modules") [FieldLine [] "MyLib"]]R cabal-fixA getter of section fieldsS cabal-fix'A getter by name of a field or section.T cabal-fixA mapping into the field structure, operating on field lists in sections as well as the field itself.U cabal-fixA mapping into the field structure, operating on field lists in sections as well as field lists themselves.V cabal-fix-Project name. Errors if the field is missing.pname cf "minimal"W cabal-fixName of (field or section).head fs & view fieldName'"cabal-version"X cabal-fixLens into field linesfs & foldOf (section' "test-suite" % each % secFields' % field' "build-depends" % each % fieldLines')9[FieldLine [] "base ^>=4.17.2.1,",FieldLine [] "minimal"]Y cabal-fix'lens into SectionArg part of a section.$Errors if you actually have a field.5fs & foldOf (section' "test-suite" % each % secArgs')[SecArgName [] "minimal-test"]Z cabal-fix,secArg lens into a ByteString representationfs & foldOf (section' "test-suite" % each % secArgs' % each % secArgBS')("name","minimal-test")[ cabal-fixlens into field line contents.fs & toListOf (section' "test-suite" % each % secFields' % field' "build-depends" % each % fieldLines' % each % fieldLine')["base ^>=4.17.2.1,","minimal"]\ cabal-fix)A fold of a field list into a ByteString.] cabal-fix fix order:removes fieldsremoves blank fields fixes commas adds Fieldsfix build dependenciessort field lines sort fields^ cabal-fixFix a cabal file in-place cabal-fixIs the field blank (including has no section arguments if a section)_ cabal-fix#Fix the comma usage in a field listfs & toListOf (section' "test-suite" % each % secFields' % field' "build-depends" % each) & fmap (fixesCommas cfg)[Field (Name [] "build-depends") [FieldLine [] ", base ^>=4.17.2.1",FieldLine [] ", minimal"]]` cabal-fix add fieldsaddsFields (cfg & set #addFields [("description", "added by addsFields", AddReplace)]) [][Field (Name [] "description") [FieldLine [] "added by addsFields"]]a cabal-fix&Add a field according to an AddPolicy.b cabal-fixAlign dependencies (if depAlignment is DepAligned), remove ranges for any self-dependency, and substitute preferred dependency ranges.fs & toListOf (section' "test-suite" % each % secFields' % field' "build-depends" % each) & fmap (fixBuildDeps cfg "minimal")[Field (Name [] "build-depends") [FieldLine [] ", base >=4.14 && <5",FieldLine [] ", minimal"]] cabal-fix"sort field lines for listed fields cabal-fix5sorting fields, based on fieldOrdering configuration.A secondary ordering is based on the first fieldline (for fields) or section args (for sections).c cabal-fixPrinting Convert a  to a printCabalFields cfg (cf & over (#fields % fieldList') (take 4)) & C.putStrcabal-version: 3.0 name: minimalversion: 0.1.0.0license: BSD-2-Clause cabal-fixUsed in . cabal-fixUsed in . cabal-fix! with user specified indentation.d cabal-fixParse a  into a . Failure is possible.8bs & C.lines & take 4 & C.unlines & parseCabalFields cfgRight (CabalFields {fields = [Field (Name [] "cabal-version") [FieldLine [] "3.0"],Field (Name [] "name") [FieldLine [] "minimal"],Field (Name [] "version") [FieldLine [] "0.1.0.0"],Field (Name [] "license") [FieldLine [] "BSD-2-Clause"]], endComment = []})e cabal-fixMinimal cabal file contents for testing purposes. Originally created via: mkdir minimal && cd minimal && cabal init --minimal --simple --overwrite --lib --tests --language=GHC2021 --license=BSD-2-Clause -p minimalf cabal-fixA config close to the  cabal init styles.g cabal-fix%Collapse margins, any margin = margin cabal-fix?Convert an annotation to lined to preceed the field or section. cabal-fix+Post-process non-annotation produced lines. cabal-fixIndentation level. cabal-fixFields/sections to show.89:;<=>?@ABCDEFGHIJK,-./34567012&'()+*#$%" !MLNOPQRSTUVXWYZ[\dc]^_`abef89:;<=>?@ABCDEFGHIJK,-./34567012&'()+*#$%" !MLNOPQRSTUVXWYZ[\dc]^_`abef Safe-Inferred"0 cabal-fix%The naming convention in 01-index.tar cabal-fixthe cabal index cabal-fix9all the tar entries that represent packages of some kind. cabal-fix6Convert a ByteString to a FileName. Errors on failure. cabal-fixFileName parser cabal-fix cabal files,Discards stale versions with later revisions cabal-fixAssumes cabal entries are in chronological order and that the last version encountered is the latest valid one. cabal-fixLatest successfully parsing  cabal-fixextract library build-deps from a Field list, also looking in common stanzas cabal-fixMap of valid dependencies cabal-fixGraph of all valid dependencies cabal-fix"count distinct elements of a list. cabal-fix collect distinct monoidal values cabal-fix Get the set of upstream projects cabal-fix#Get the set of downstream projects. cabal-fix7Get the upstream graph of a library. text, for example: cabal-fix:Create a dot graph from an algebraic graph of dependencies cabal-fix&make an svg file of a dependency graph other/textdeps.svg text example Safe-Inferred2, cabal-fix% with unchanged sections filtered out.showPatch $ patch [1, 2, 3, 5] [0, 1, 2, 4, 6]"[+0, -3, +4, -5, +6]" cabal-fix*Create a String representation of a patch.          !"##$%&&'()**+,-./0123456789:;<=>>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(cabal-fix-0.0.0.2-GueGPKFkv7p1skPCP5Ed4HCabalFix.FlatParseCabalFixCabalFix.ArchiveCabalFix.Patch cabal-fix(flatparse-0.5.0.1-5BSbmAdQmMz8lbn3J8HkqbFlatParse.Basic.ParserParserFlatParse.BasicResultOKFailErr runParser ParserWarningParserLeftover ParserErrorParserUncaughtrunParserMayberunParserEither runParserWarn runParser_ runParser__ws_wsnotauntilPdepPversionP versionInts$fEqParserWarning$fShowParserWarning$fOrdParserWarning$fGenericParserWarningDepdepdepRange CabalFieldsfields endCommentCommentMarginNoMargin DepAlignment DepAligned DepUnalignedValueAlignment ValueAlignedValueUnaligned AddPolicy AddReplace AddAppendAddIfNotExisting CommaTrailTrailer NoTrailer CommaStyle PrefixCommas PostfixCommasFreeformCommasNoCommasConfig freeTexts fieldRemovals preferredDeps addFields fixCommassortFieldLines doSortFields fieldOrderingdoFixBuildDeps depAlignmentremoveBlankFields valueAligned valueAlignGap sectionMargin commentMarginnarrowNindentN defaultConfig fieldList' cabalFields' topfield'field' subfield'section' secFields'fieldOrSection' overField overFieldspname fieldName' fieldLines'secArgs' secArgBS' fieldLine' fieldValues'fixCabalFields fixCabalFile fixesCommas addsFieldsaddField fixBuildDepsprintCabalFieldsparseCabalFieldsminimalExampleBS minimalConfig$fSemigroupMargin $fToExprField$fToExprSectionArg $fToExprName$fToExprFieldLine$fToExprCabalFields$fMonoidCabalFields$fSemigroupCabalFields $fEqFieldPath$fOrdFieldPath$fShowFieldPath $fShowBlock $fEqBlock $fReadBlock$fGenericBlock $fShowDep$fOrdDep$fEqDep $fGenericDep$fGenericCabalFields$fEqCabalFields$fShowCabalFields $fEqConfig $fShowConfig $fReadConfig$fGenericConfig $fEqMargin $fShowMargin $fReadMargin$fGenericMargin$fEqDepAlignment$fShowDepAlignment$fReadDepAlignment$fEqValueAlignment$fShowValueAlignment$fReadValueAlignment$fGenericValueAlignment $fEqAddPolicy$fShowAddPolicy$fReadAddPolicy$fGenericAddPolicy$fEqCommaTrail$fShowCommaTrail$fReadCommaTrail$fGenericCommaTrail$fEqCommaStyle$fShowCommaStyle$fReadCommaStyle$fGenericCommaStyleFileNamenameFN versionFN filenameFN cabalIndex cabalEntriesfilename filenamePcabals latestCabalslatestCabalFieldslibDeps validLibDeps allDepGraphcount_collect_ upstreams downstreams upstreamG dotUpstreamdotUpstreamSvg$fGenericFileName $fEqFileName $fOrdFileName$fShowFileNamepatch showPatch isWhitespacedigitintghc-prim GHC.TypesIntBlockCabal-syntax-3.10.1.0Distribution.Fields.Field FieldLineFielddefaultFieldOrderingbytestring-0.11.5.2Data.ByteString.Internal.Type ByteString isBlankFieldsortFieldLinesFor sortFieldsprettyFieldLinesDistribution.Fields.PrettyfromParsecFieldsprettySectionArgsshowFieldsIndent showFields(tree-diff-0.3.0.1-2zbHGEx9c5zJ2zUz4Xor7OData.TreeDiff.Classediff