[Git][ghc/ghc][wip/expand-do] 49 commits: Hadrian: enable GHCi support on riscv64

Apoorv Ingle (@ani) gitlab at gitlab.haskell.org
Sun Jul 16 18:10:00 UTC 2023



Apoorv Ingle pushed to branch wip/expand-do at Glasgow Haskell Compiler / GHC


Commits:
dd38aca9 by Andreas Schwab at 2023-07-11T13:55:56+00:00
Hadrian: enable GHCi support on riscv64

- - - - -
09a5c6cc by Josh Meredith at 2023-07-12T11:25:13-04:00
JavaScript: support unicode code points > 2^16 in toJSString using String.fromCodePoint (#23628)

- - - - -
29fbbd4e by Matthew Pickering at 2023-07-12T11:25:49-04:00
Remove references to make build system in mk/build.mk

Fixes #23636

- - - - -
630e3026 by sheaf at 2023-07-12T11:26:43-04:00
Valid hole fits: don't panic on a Given

The function GHC.Tc.Errors.validHoleFits would end up panicking when
encountering a Given constraint. To fix this, it suffices to filter out
the Givens before continuing.

Fixes #22684

- - - - -
c39f279b by Matthew Pickering at 2023-07-12T23:18:38-04:00
Use deb10 for i386 bindists

deb9 is now EOL so it's time to upgrade the i386 bindist to use deb10

Fixes #23585

- - - - -
bf9b9de0 by Krzysztof Gogolewski at 2023-07-12T23:19:15-04:00
Fix #23567, a specializer bug

Found by Simon in https://gitlab.haskell.org/ghc/ghc/-/issues/23567#note_507834

The testcase isn't ideal because it doesn't detect the bug in master,
unless doNotUnbox is removed as in
https://gitlab.haskell.org/ghc/ghc/-/issues/23567#note_507692.
But I have confirmed that with that modification, it fails before
and passes afterwards.

- - - - -
84c1a4a2 by Bartłomiej Cieślar at 2023-07-12T23:20:08-04:00
Comments

- - - - -
b2846cb5 by Bartłomiej Cieślar at 2023-07-12T23:20:08-04:00
updates to comments

- - - - -
2af23f0e by Bartłomiej Cieślar at 2023-07-12T23:20:08-04:00
changes

- - - - -
6143838a by sheaf at 2023-07-13T08:02:17-04:00
Fix deprecation of record fields

Commit 3f374399 inadvertently broke the deprecation/warning mechanism
for record fields due to its introduction of record field namespaces.

This patch ensures that, when a top-level deprecation is applied to
an identifier, it applies to all the record fields as well.
This is achieved by refactoring GHC.Rename.Env.lookupLocalTcNames, and
GHC.Rename.Env.lookupBindGroupOcc, to not look up a fixed number of
NameSpaces but to look up all NameSpaces and filter out the irrelevant
ones.

- - - - -
6fd8f566 by sheaf at 2023-07-13T08:02:17-04:00
Introduce greInfo, greParent

These are simple helper functions that wrap the internal
field names gre_info, gre_par.

- - - - -
7f0a86ed by sheaf at 2023-07-13T08:02:17-04:00
Refactor lookupGRE_... functions

This commit consolidates all the logic for looking up something in
the Global Reader Environment into the single function lookupGRE.
This allows us to declaratively specify all the different modes of
looking up in the GlobalRdrEnv, and avoids manually passing around
filtering functions as was the case in e.g. the function
GHC.Rename.Env.lookupSubBndrOcc_helper.

-------------------------
Metric Decrease:
    T8095
-------------------------
-------------------------
Metric Increase:
    T8095
-------------------------

- - - - -
5e951395 by Rodrigo Mesquita at 2023-07-13T08:02:54-04:00
configure: Drop DllWrap command

We used to configure into settings a DllWrap command for windows
builds and distributions, however, we no longer do, and dllwrap is
effectively unused.

This simplification is motivated in part by the larger
toolchain-selection project (#19877, !9263)

- - - - -
e10556b6 by Teo Camarasu at 2023-07-14T16:28:46-04:00
base: fix haddock syntax in GHC.Profiling

- - - - -
0f3fda81 by Matthew Pickering at 2023-07-14T16:29:23-04:00
Revert "CI: add JS release and debug builds, regen CI jobs"

This reverts commit 59c5fe1d4b624423b1c37891710f2757bb58d6af.

This commit added two duplicate jobs on all validate pipelines, so we
are reverting for now whilst we work out what the best way forward is.

Ticket #23618

- - - - -
54bca324 by Alan Zimmerman at 2023-07-15T03:23:26-04:00
EPA: Simplify GHC/Parser.y sLL

Follow up to !10743

- - - - -
c8863828 by sheaf at 2023-07-15T03:24:06-04:00
Configure: canonicalise PythonCmd on Windows

This change makes PythonCmd resolve to a canonical absolute path on
Windows, which prevents HLS getting confused (now that we have a
build-time dependency on python).

fixes #23652

- - - - -
ca1e636a by Rodrigo Mesquita at 2023-07-15T03:24:42-04:00
Improve Note [Binder-swap during float-out]

- - - - -
cf86f3ec by Matthew Craven at 2023-07-16T01:42:09+02:00
Equality of forall-types is visibility aware

This patch finally (I hope) nails the question of whether
   (forall a. ty) and (forall a -> ty)
are `eqType`: they aren't!

There is a long discussion in #22762, plus useful Notes:

* Note [ForAllTy and type equality] in GHC.Core.TyCo.Compare
* Note [Comparing visiblities] in GHC.Core.TyCo.Compare
* Note [ForAllCo] in GHC.Core.TyCo.Rep

It also establishes a helpful new invariant for ForAllCo,
and ForAllTy, when the bound variable is a CoVar:in that
case the visibility must be coreTyLamForAllTyFlag.

All this is well documented in revised Notes.

- - - - -
7f13acbf by Vladislav Zavialov at 2023-07-16T01:56:27-04:00
List and Tuple<n>: update documentation

Add the missing changelog.md entries and @since-annotations.

- - - - -
2afbddb0 by Andrei Borzenkov at 2023-07-16T10:21:24+04:00
Type patterns (#22478, #18986)

Improved name resolution and type checking of type patterns in constructors:

1. HsTyPat: a new dedicated data type that represents type patterns in
   HsConPatDetails instead of reusing HsPatSigType

2. rnHsTyPat: a new function that renames a type
   pattern and collects its binders into three groups:
    - explicitly bound type variables, excluding locally bound
      variables
    - implicitly bound type variables from kind signatures
      (only if ScopedTypeVariables are enabled)
    - named wildcards (only from kind signatures)
2a. rnHsPatSigTypeBindingVars: removed in favour of rnHsTyPat
2b. rnImplcitTvBndrs: removed because no longer needed

3. collect_pat: updated to collect type variable binders from type patterns
   (this means that types and terms use the same infrastructure to detect
   conflicting bindings, unused variables and name shadowing)
3a. CollVarTyVarBinders: a new CollectFlag constructor that enables
    collection of type variables

4. tcHsTyPat: a new function that typechecks type patterns, capable of
   handling polymorphic kinds.
   See Note [Type patterns: binders and unifiers]

Examples of code that is now accepted:

   f = \(P @a) -> \(P @a) -> ...  -- triggers -Wname-shadowing

   g :: forall a. Proxy a -> ...
   g (P @a) = ...                 -- also triggers -Wname-shadowing

   h (P @($(TH.varT (TH.mkName "t")))) = ...
                                  -- t is bound at splice time

   j (P @(a :: (x,x))) = ...      -- (x,x) is no longer rejected

   data T where
     MkT :: forall (f :: forall k. k -> Type).
       f Int -> f Maybe -> T
   k :: T -> ()
   k (MkT @f (x :: f Int) (y :: f Maybe)) = ()
                                  -- f :: forall k. k -> Type

Examples of code that is rejected with better error messages:

  f (Left @a @a _) = ...
  -- new message:
  --     • Conflicting definitions for ‘a’
  --       Bound at: Test.hs:1:11
  --                 Test.hs:1:14

Examples of code that is now rejected:

  {-# OPTIONS_GHC -Werror=unused-matches #-}
  f (P @a) = ()
  -- Defined but not used: type variable ‘a’

- - - - -
eb1a6ab1 by sheaf at 2023-07-16T09:20:45-04:00
Don't use substTyUnchecked in newMetaTyVar

There were some comments that explained that we needed to use an
unchecked substitution function because of issue #12931, but that
has since been fixed, so we should be able to use substTy instead now.

- - - - -
b49aa787 by Apoorv Ingle at 2023-07-16T13:09:30-05:00
Fixes #18324 #23147
Expands do notation before typechecking using `HsExpansion`
- Adds testcases T18324, T18324b, DoubleMatch
Expands
- Do statements
- Monadic do statements
- monadic fix blocks
- make sure fail is used for pattern match failures in bind statments
- Makes sure unused binds generate warnings
- runs the pattern match check in generated lambda exprs to avoid getting suprious pattern match failures. c.f. pmcheck/should_compile/DoubleMatch.hs
- PopSrcSpan in HsExpr to pop error context
- Discards default monad fail alternatives that are spuriously generated
- Make sure we check for generated loc span for checking if the (>>) is user written or expanded for /do/ purposes

- - - - -
1f0650c7 by Apoorv Ingle at 2023-07-16T13:09:30-05:00
- Add PopSrcSpan (XXExprGhcRn) in appropriate places while expanding statements
- correct source spans displayed for warnDiscardedDoBindings
- use `mkExpandStmt` to store original stmts along with expanded expr for using the right context for error message printing
- improves error messages for applicative do
- remove special case from isMatchContextPmChecked (long distance info is now properly propogated)
- set correct src spans to statement expansions
- Match ctxt while type checking HsLam is different if the lambda match is due to an expression generated from a do block
- call tcExpr and not tcApp in PopSrcSpan so make sure impredicativity works fine
- look into XExprs in tcInferAppHead_maybe for infering the type to make T18324 typecheck and run

- - - - -
2c4bf5ba by Apoorv Ingle at 2023-07-16T13:09:30-05:00
generate incomplete uni patterns warnings if the origin context is a generated do expansion

- - - - -
f1201d1c by Apoorv Ingle at 2023-07-16T13:09:30-05:00
use the correct bind operator for qualified rebindable rec do expansions

- - - - -
453b4c7f by Apoorv Ingle at 2023-07-16T13:09:30-05:00
trying out changes to heralds

- - - - -
d8093947 by Apoorv Ingle at 2023-07-16T13:09:30-05:00
add location information for last statements

- - - - -
056dd32f by Apoorv Ingle at 2023-07-16T13:09:30-05:00
do not pop context while checking the second argument to expanded (>>)

- - - - -
62e8ca9c by Apoorv Ingle at 2023-07-16T13:09:30-05:00
adjusting the generated spans for proper error messages

- - - - -
52a786c3 by Apoorv Ingle at 2023-07-16T13:09:30-05:00
change the addHeadCtxt to include the first statement of the do block for more precise error messages

- - - - -
835ad30a by Apoorv Ingle at 2023-07-16T13:09:30-05:00
- don't add any ctxt in addExprCtxt for `XExpr(ExpandedStmt{})` as it is not very useful, the statement ctxt is already added by `tcExpr` and `addHeadCtxt`

- - - - -
0640afc7 by Apoorv Ingle at 2023-07-16T13:09:30-05:00
- addStmtCtxt to add the right statement context in the error contexts
- expansion stmt to span over bind/>>= application and pattern rather than only the arguments

- - - - -
875ff85d by Apoorv Ingle at 2023-07-16T13:09:31-05:00
add stmt context in tcApp rather other places

- - - - -
4a99a732 by Apoorv Ingle at 2023-07-16T13:09:31-05:00
add the correct expression context in tcApp

- - - - -
9deeeb00 by Apoorv Ingle at 2023-07-16T13:09:31-05:00
disable expansion if applicative do is enabled

- - - - -
5669da25 by Apoorv Ingle at 2023-07-16T13:09:31-05:00
handle a special in desugaring when a do block has only one statment, the ds location should be set to that of the last statement

- - - - -
4a3c386d by Apoorv Ingle at 2023-07-16T13:09:31-05:00
do not add argument context if it is a do statement

- - - - -
c6e5eb2e by Apoorv Ingle at 2023-07-16T13:09:31-05:00
remove applicative do expansion

- - - - -
e1bceb04 by Apoorv Ingle at 2023-07-16T13:09:31-05:00
add context of first do statement in addArgCtxt, somehow it goes missing

- - - - -
c727ace7 by Apoorv Ingle at 2023-07-16T13:09:31-05:00
add the argument location in error ctxt if it is the first argument of a >> or a >>=

- - - - -
8ce2e53e by Apoorv Ingle at 2023-07-16T13:09:31-05:00
- make the ExpandedStmt generated expression location-less
- Introduce ExpansionStmt for proper `hsSplitApps`
- Introduce `VAExpansionStmt` that is just like `VAExpansion` but for statements

- - - - -
dbd37282 by Apoorv Ingle at 2023-07-16T13:09:31-05:00
some cleanup needed

- - - - -
7ddb10de by Apoorv Ingle at 2023-07-16T13:09:31-05:00
- VAExpansionStmt doesn't need srcloc
- fix the ppr function for XExprs

- - - - -
e3f2d4ed by Apoorv Ingle at 2023-07-16T13:09:31-05:00
- Blame the binding body but keep the error context about the statement in addArgCtxt

- - - - -
29a0f033 by Apoorv Ingle at 2023-07-16T13:09:31-05:00
- fix the location displayed for the errors that crop up during type checking LetStmt

- - - - -
810c1a4b by Apoorv Ingle at 2023-07-16T13:09:31-05:00
Add the statement context in addHeadCtxt

- - - - -
98d4359f by Apoorv Ingle at 2023-07-16T13:09:31-05:00
make sure user >> and generated >> have appropriate error messages

- - - - -
9550f631 by Apoorv Ingle at 2023-07-16T13:09:31-05:00
- aligning expand stmt context pushing on error stack.

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Reduction.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCo/FVs.hs-boot
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCo/Tidy.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Data/FastString.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/257c8fc24d49de94d25dcc80c1aa7786a4557042...9550f631dca4fd38643124de63cbbce820508788

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/257c8fc24d49de94d25dcc80c1aa7786a4557042...9550f631dca4fd38643124de63cbbce820508788
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/20230716/84a7d42c/attachment-0001.html>


More information about the ghc-commits mailing list