Skip to content
Snippets Groups Projects
  1. Apr 12, 2023
    • Oleg Grenrus's avatar
      Allow generation of TTH syntax with TH · ebd8918b
      Oleg Grenrus authored and Marge Bot's avatar Marge Bot committed
      In other words allow generation of typed splices and brackets with
      Untyped Template Haskell.
      
      That is useful in cases where a library is build with TTH in mind,
      but we still want to generate some auxiliary declarations,
      where TTH cannot help us, but untyped TH can.
      Such example is e.g. `staged-sop` which works with TTH,
      but we would like to derive `Generic` declarations with TH.
      
      An alternative approach is to use `unsafeCodeCoerce`, but then the
      derived `Generic` instances would be type-checked only at use sites,
      i.e. much later. Also `-ddump-splices` output is quite ugly:
      user-written instances would use TTH brackets, not `unsafeCodeCoerce`.
      
      This commit doesn't allow generating of untyped template splices
      and brackets with untyped TH, as I don't know why one would want to do
      that (instead of merging the splices, e.g.)
      ebd8918b
  2. Apr 11, 2023
  3. Apr 08, 2023
  4. Apr 07, 2023
  5. Apr 06, 2023
  6. Apr 04, 2023
    • sheaf's avatar
      Add testcase for #23192 · c165f079
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This issue around solving of constraints arising from superclass
      expansion using other constraints also borned from superclass expansion
      was the topic of commit aed1974e. That commit made sure we don't emit
      a "redundant constraint" warning in a situation in which removing the
      constraint would cause errors.
      
      Fixes #23192
      c165f079
    • Krzysztof Gogolewski's avatar
      Fix unification with oversaturated type families · 7c16f3be
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      unify_ty was incorrectly saying that F x y ~ T x are surely apart,
      where F x y is an oversaturated type family and T x is a tyconapp.
      As a result, the simplifier dropped a live case alternative (#23134).
      7c16f3be
    • Ryan Scott's avatar
      Make INLINE pragmas for pattern synonyms work with TH · 071139c3
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      Previously, the code for converting `INLINE <name>` pragmas from TH splices
      used `vNameN`, which assumed that `<name>` must live in the variable namespace.
      Pattern synonyms, on the other hand, live in the constructor namespace. I've
      fixed the issue by switching to `vcNameN` instead, which works for both the
      variable and constructor namespaces.
      
      Fixes #23203.
      071139c3
    • Sylvain Henry's avatar
      GHCi.RemoteTypes: fix doc and avoid unsafeCoerce (#23201) · eed0d930
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      eed0d930
    • sheaf's avatar
      Relax assertion in varToRecFieldOcc · cd00e321
      sheaf authored and Marge Bot's avatar Marge Bot committed
      When using Template Haskell, it is possible to re-parent a field OccName
      belonging to one data constructor to another data constructor. The
      lsp-types package did this in order to "extend" a data constructor
      with additional fields.
      
      This ran into an assertion in 'varToRecFieldOcc'. This assertion
      can simply be relaxed, as the resulting splices are perfectly sound.
      
      Fixes #23220
      cd00e321
    • Matthew Craven's avatar
      StgToCmm: Upgrade -fcheck-prim-bounds behavior · f7da530c
      Matthew Craven authored and Marge Bot's avatar Marge Bot committed
      Fixes #21054. Additionally, we can now check for range overlap
      when generating Cmm for primops that use memcpy internally.
      f7da530c
    • Matthew Craven's avatar
      Add a few more memcpy-ish primops · 9095e297
      Matthew Craven authored and Marge Bot's avatar Marge Bot committed
      * copyMutableByteArrayNonOverlapping#
      * copyAddrToAddr#
      * copyAddrToAddrNonOverlapping#
      * setAddrRange#
      
      The implementations of copyBytes, moveBytes, and fillBytes
      in base:Foreign.Marshal.Utils now use these new primops,
      which can cause us to work a bit harder generating code for them,
      resulting in the metric increase in T21839c observed by CI on
      some architectures.  But in exchange, we get better code!
      
      Metric Increase:
          T21839c
      9095e297
  7. Apr 03, 2023
    • Krzysztof Gogolewski's avatar
      Fixes around unsafeCoerce# · 220a7a48
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      1. `unsafeCoerce#` was documented in `GHC.Prim`. But since the overhaul
      in 74ad75e8, `unsafeCoerce#` is no longer defined there.
      I've combined the documentation in `GHC.Prim` with the `Unsafe.Coerce` module.
      
      2. The documentation of `unsafeCoerce#` stated that you should not
      cast a function to an algebraic type, even if you later cast it back
      before applying it. But ghci was doing that type of cast, as can be seen
      with 'ghci -ddump-ds' and typing 'x = not'. I've changed it to use Any
      following the documentation.
      220a7a48
    • Haskell-mouse's avatar
      Convert diagnostics in GHC.Rename.HsType to proper TcRnMessage · 8b092910
      Haskell-mouse authored and Marge Bot's avatar Marge Bot committed
      I've turned all occurrences of TcRnUnknownMessage in GHC.Rename.HsType
      module into a proper TcRnMessage.
      Instead, these TcRnMessage messages were introduced:
      
      TcRnDataKindsError
      TcRnUnusedQuantifiedTypeVar
      TcRnIllegalKindSignature
      TcRnUnexpectedPatSigType
      TcRnSectionPrecedenceError
      TcRnPrecedenceParsingError
      TcRnIllegalKind
      TcRnNegativeNumTypeLiteral
      TcRnUnexpectedKindVar
      TcRnBindMultipleVariables
      TcRnBindVarAlreadyInScope
      8b092910
    • Sylvain Henry's avatar
      JS: fix issues with FD api support · a8e36892
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      - Add missing implementations for fcntl_read/write/lock
      - Fix fdGetMode
      
      These were found while implementing TH in !9779. These functions must be
      used somehow by the external interpreter code.
      a8e36892
    • Krzysztof Gogolewski's avatar
      hadrian: Improve option parsing · 53e4d513
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      Several options in Hadrian had their argument marked as optional
      (`OptArg`), but if the argument wasn't there they were just giving an
      error. It's more idiomatic to mark the argument as required instead;
      the code uses less Maybes, the parser can enforce that the argument
      is present, --help gives better output.
      53e4d513
    • Matthew Pickering's avatar
      ci: Add job to test 9.6 bootstrapping · c2605e25
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      c2605e25
    • Matthew Pickering's avatar
      hadrian: Update bootstrap plans for 9.2.6, 9.2.7, 9.4.4, 9.4.5, 9.6.1 · 2b2afff3
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      Also fixes the ./generate_bootstrap_plans script which was recently
      broken
      
      We can hopefully drop the 9.2 plans soon but they still work so kept
      them around for now.
      2b2afff3
    • Sylvain Henry's avatar
      ghc-heap: remove wrong Addr# coercion (#23181) · ab9cd52d
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      Conversion from Addr# to I# isn't correct with the JS backend.
      ab9cd52d
  8. Apr 02, 2023
  9. Apr 01, 2023
    • sheaf's avatar
      TH: revert changes to GadtC & RecGadtC · 3b7bbb39
      sheaf authored and Marge Bot's avatar Marge Bot committed
      Commit 3f374399 included a breaking-change to the template-haskell
      library when it made the GadtC and RecGadtC constructors take non-empty
      lists of names. As this has the potential to break many users' packages,
      we decided to revert these changes for now.
      3b7bbb39
    • sheaf's avatar
      Improve haddocks of template-haskell Con datatype · 3da69346
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This adds a bit more information, in particular about the lists of
      constructors in the GadtC and RecGadtC cases.
      3da69346
    • jeffrey young's avatar
      JS: Linker: use saturated JExpr · 6e2eb275
      jeffrey young authored and Marge Bot's avatar Marge Bot committed
      Follow on to MR!10142 in pursuit of #22736
      6e2eb275
    • Torsten Schmits's avatar
      Add structured error messages for GHC.Tc.TyCl · a84fba6e
      Torsten Schmits authored and Marge Bot's avatar Marge Bot committed
      Tracking ticket: #20117
      
      MR: !10183
      
      This converts uses of `mkTcRnUnknownMessage` to newly added constructors
      of `TcRnMessage`.
      a84fba6e
    • jeffrey young's avatar
      driver: Unit State Data.Map -> GHC.Unique.UniqMap · 3b5be05a
      jeffrey young authored and Marge Bot's avatar Marge Bot committed
      In pursuit of #22426. The driver and unit state are major contributors.
      
      This commit also bumps the haddock submodule to reflect the API changes in
      UniqMap.
      
      -------------------------
      Metric Decrease:
          MultiComponentModules
          MultiComponentModulesRecomp
          T10421
          T10547
          T12150
          T12234
          T12425
          T13035
          T16875
          T18140
          T18304
          T18698a
          T18698b
          T18923
          T20049
          T5837
          T6048
          T9198
      -------------------------
      3b5be05a
    • Artem Pelenitsyn's avatar
      User Guide: update copyright year: 2020->2023 · 77c33fb9
      Artem Pelenitsyn authored and Marge Bot's avatar Marge Bot committed
      77c33fb9
    • Magnus Viernickel's avatar
      [feat] make ($) representation polymorphic · 62d25071
      Magnus Viernickel authored and Marge Bot's avatar Marge Bot committed
      - this change was approved by the CLC in [1] following a CLC proposal [2]
      - make ($) representation polymorphic (adjust the type signature)
      - change ($) implementation to allow additional polymorphism
      - adjust the haddock of ($) to reflect these changes
      - add additional documentation to document these changes
      - add changelog entry
      - adjust tests (move now succeeding tests and adjust stdout of some
        tests)
      
      [1] https://github.com/haskell/core-libraries-committee/issues/132#issuecomment-1487456854
      [2] https://github.com/haskell/core-libraries-committee/issues/132
      62d25071
    • Matthew Pickering's avatar
      Add test for T23184 · 0077cb22
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There was an outright bug, which Simon fixed in July 2021, as a little side-fix on a complicated patch:
      
      ```
      commit 6656f016
      Author: Simon Peyton Jones <simonpj@microsoft.com>
      Date:   Fri Jul 23 23:57:01 2021 +0100
      
          A bunch of changes related to eta reduction
      
          This is a large collection of changes all relating to eta
          reduction, originally triggered by #18993, but there followed
          a long saga.
      
          Specifics:
      
      ...lots of lines omitted...
      
          Other incidental changes
      
          * Fix a fairly long-standing outright bug in the ApplyToVal case of
            GHC.Core.Opt.Simplify.mkDupableContWithDmds. I was failing to take the
            tail of 'dmds' in the recursive call, which meant the demands were All
            Wrong.  I have no idea why this has not caused problems before now.
      ```
      
      Note this "Fix a fairly longstanding outright bug".   This is the specific fix
      ```
      @@ -3552,8 +3556,8 @@ mkDupableContWithDmds env dmds
               --              let a = ...arg...
               --              in [...hole...] a
               -- NB: sc_dup /= OkToDup; that is caught earlier by contIsDupable
      -    do  { let (dmd:_) = dmds   -- Never fails
      -        ; (floats1, cont') <- mkDupableContWithDmds env dmds cont
      +    do  { let (dmd:cont_dmds) = dmds   -- Never fails
      +        ; (floats1, cont') <- mkDupableContWithDmds env cont_dmds cont
               ; let env' = env `setInScopeFromF` floats1
               ; (_, se', arg') <- simplArg env' dup se arg
               ; (let_floats2, arg'') <- makeTrivial env NotTopLevel dmd (fsLit "karg") arg'
      ```
      Ticket #23184 is a report of the bug that this diff fixes.
      0077cb22
  10. Mar 30, 2023
    • Cheng Shao's avatar
      testsuite: asyncify the testsuite driver · ea853ff0
      Cheng Shao authored
      This patch refactors the testsuite driver, gets rid of multi-threading
      logic for running test cases concurrently, and uses asyncio &
      coroutines instead. This is not yak shaving for its own sake; the
      previous multi-threading logic is prone to livelock/deadlock
      conditions for some reason, even if the total number of threads is
      bounded to a thread pool's capacity.
      
      The asyncify change is an internal implementation detail of the
      testsuite driver and does not impact most GHC maintainers out there.
      The patch does not touch the .T files, test cases can be
      added/modified the exact same way as before.
      ea853ff0
Loading