[Git][ghc/ghc][wip/soulomoon/suggest-UnliftedNewtypes-unlifted-data-family-25593] 4 commits: Remove SDocs from ErrCtxt & ErrInfo

Patrick (@soulomoon) gitlab at gitlab.haskell.org
Mon Jan 13 18:32:28 UTC 2025



Patrick pushed to branch wip/soulomoon/suggest-UnliftedNewtypes-unlifted-data-family-25593 at Glasgow Haskell Compiler / GHC


Commits:
2e7bf446 by sheaf at 2025-01-13T10:55:26+01:00
Remove SDocs from ErrCtxt & ErrInfo

This commit:

  - turns the SDoc used in ErrCtxt into a proper error datatype,
    ErrCtxtMsg, which contains all the different error contexts that
    can be added,

  - replaces ErrInfo with [ErrCtxt].
    ErrInfo used to contain two SDocs; the first is replaced with [ErrCtxt],
    and the second is removed, with the relevant information being put
    in the appropriate error message constructors.

Fixes #23436

- - - - -
2d62b970 by Mike Pilgrem at 2025-01-13T12:59:10-05:00
Re CLC #300 - Specify fmap for NonEmpty as map

See:
* https://github.com/haskell/core-libraries-committee/issues/300

Seeks to:
* move existing instances for NonEmpty (except of Eq and Ord) out of GHC.Internal.Base into new GHC.Internal.Data.NonEmpty (to avoid otherwise unavoidable cycles in the module graph);
* move map out of Data.List.NonEmpty (base package) into GHC.Internal.Data.NonEmpty;
* define fmap as map for NonEmpty instance of Functor, avoiding code duplication;
* re-export map from existing GHC.Internal.Data.List.NonEmpty; and
* re-export map from Data.List.NonEmpty (base package);

without breaking anything in the GHC repository.

Various tests *.stdout and *.stderr files are amended also.

- - - - -
ab3ab3e3 by Luite Stegeman at 2025-01-13T12:59:58-05:00
compiler/coreprep: Turn off dictionary speculation by default

Speculative evaluation can cause performance regressions,
therefore we turn it off by default. It can be enabled again
with the -fspec-eval-dictfun flag

See #25284

- - - - -
040c4294 by Patrick at 2025-01-14T02:30:44+08:00
Enhance kind inference for data family instances
This commit improves kind inference for data family instances by kind-checking
the constructors, for H98 and newtype declarations (ONLY), as well as
kind-checking the result kind signature (when using GADT syntax).
This fixes #25611.

Typechecker changes:
In `tcDataFamInstHeader`, we now kind-check the constructors using
`kcConDecls`, for H98-style decls and newtype decls ONLY.
See Note [Kind inference for data family instances].

Testsuite changes:
  - The T25611{a,b,c,d} tests test the new kind inference implementation.
    - a,b: infer result kind from constructors (H98 case)
    - c: renamed version of test UnliftedNewtypesUnassociatedFamilyFail,
      which now passes
    - d: GADT case, checking that we don't infer overly rigid kinds when
         kind-checking the constructors in data family instances.
 - DataInstanceKindsDefaults tests defaulting data instance kinds
   without UnliftedNewtypes or UnliftedDatatypes, as outlined in
   Note [Defaulting result kind of newtype/data family instance].

Also a few notes are updated to reflect the changes.

Co-authored-by: default avatarSimon Peyton Jones <simon.peytonjones at gmail.com>

- - - - -


30 changed files:

- compiler/GHC/Core/TyCon.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Infer.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Hole.hs-boot
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Errors/Types/PromotionErr.hs
- compiler/GHC/Tc/Gen/Annotation.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1afaf853f59c7d4bd80a79639d375be15380faf5...040c429472850832e3a75c310bc0e23f1f82cc88

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1afaf853f59c7d4bd80a79639d375be15380faf5...040c429472850832e3a75c310bc0e23f1f82cc88
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20250113/16005854/attachment.html>


More information about the ghc-commits mailing list