determinism: Interface re-export list det
In 'DocStructureItem' we want to make sure the 'Avails' are sorted, for interface file determinism. This commit introduces 'DetOrdAvails', a newtype that should only be constructed by sorting Avails with 'sortAvails' unless the avails are known to be deterministically ordered. This newtype is used by 'DocStructureItem' where 'Avails' was previously used to ensure the list of avails is deterministically sorted by construction. Note: Even though we order the constructors and avails in the interface file, the order of constructors in the haddock output is still determined from the order of declaration in the source. This was also true before, when the list of constructors in the interface file <docs> section was non-deterministic. Some haddock tests such as "ConstructorArgs" observe this (check the order of constructors in out/ConstructorArgs.html vs src/ConstructorArgs.hs vs its interface file) The updated tests are caused by haddock corners where the order in the source is not preserved (and was non-deterministic before this PR): * Module header in the latex backend * Re-export of pattern synonyms associated to a datatype (#25342) Fixes #25304
Showing
- .gitlab/ci.sh 2 additions, 2 deletions.gitlab/ci.sh
- compiler/GHC/Hs/Doc.hs 2 additions, 2 deletionscompiler/GHC/Hs/Doc.hs
- compiler/GHC/HsToCore/Docs.hs 7 additions, 3 deletionscompiler/GHC/HsToCore/Docs.hs
- compiler/GHC/Iface/Make.hs 2 additions, 2 deletionscompiler/GHC/Iface/Make.hs
- compiler/GHC/Types/Avail.hs 19 additions, 2 deletionscompiler/GHC/Types/Avail.hs
- testsuite/tests/determinism/T25304/A.hs 84 additions, 0 deletionstestsuite/tests/determinism/T25304/A.hs
- testsuite/tests/determinism/T25304/B.hs 86 additions, 0 deletionstestsuite/tests/determinism/T25304/B.hs
- testsuite/tests/determinism/T25304/Makefile 25 additions, 0 deletionstestsuite/tests/determinism/T25304/Makefile
- testsuite/tests/determinism/T25304/T25304a.stdout 8 additions, 0 deletionstestsuite/tests/determinism/T25304/T25304a.stdout
- testsuite/tests/determinism/T25304/all.T 2 additions, 0 deletionstestsuite/tests/determinism/T25304/all.T
- testsuite/tests/showIface/DocsInHiFileTH.stdout 4 additions, 4 deletionstestsuite/tests/showIface/DocsInHiFileTH.stdout
- testsuite/tests/showIface/NoExportList.stdout 1 addition, 1 deletiontestsuite/tests/showIface/NoExportList.stdout
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs 11 additions, 3 deletionsutils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/html-test/ref/BundledPatterns2.html 40 additions, 40 deletionsutils/haddock/html-test/ref/BundledPatterns2.html
- utils/haddock/latex-test/ref/ConstructorArgs/ConstructorArgs.tex 1 addition, 1 deletion...addock/latex-test/ref/ConstructorArgs/ConstructorArgs.tex
- utils/haddock/latex-test/ref/DefaultSignatures/DefaultSignatures.tex 1 addition, 1 deletion...ck/latex-test/ref/DefaultSignatures/DefaultSignatures.tex
- utils/haddock/latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex 1 addition, 1 deletion...atex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex
- utils/haddock/latex-test/ref/TypeFamilies3/TypeFamilies3.tex 1 addition, 1 deletionutils/haddock/latex-test/ref/TypeFamilies3/TypeFamilies3.tex
Loading
Please register or sign in to comment