Skip to content
Snippets Groups Projects
  1. Dec 12, 2023
  2. Dec 11, 2023
    • Arnaud Spiwack's avatar
      Linear let and where bindings · 8e0446df
      Arnaud Spiwack authored
      For expediency, the initial implementation of linear types in GHC
      made it so that let and where binders would always be considered
      unrestricted. This was rather unpleasant, and probably a big obstacle
      to adoption. At any rate, this was not how the proposal was designed.
      
      This patch fixes this infelicity. It was surprisingly difficult to
      build, which explains, in part, why it took so long to materialise.
      
      As of this patch, let or where bindings marked with %1 will be
      linear (respectively %p for an arbitrary multiplicity p). Unmarked let
      will infer their multiplicity.
      
      Here is a prototypical example of program that used to be rejected and
      is accepted with this patch:
      
      ```haskell
      f :: A %1 -> B
      g :: B %1 -> C
      
      h :: A %1 -> C
      h x = g y
        where
          y = f x
      ```
      
      Exceptions:
      - Recursive let are unrestricted, as there isn't a clear semantics of
        what a linear recursive binding would be.
      - Destructive lets with lazy bindings are unrestricted, as their
        desugaring isn't linear (see also #23461).
      - (Strict) destructive lets with inferred polymorphic type are
        unrestricted. Because the desugaring isn't linear (See #18461
        down-thread).
      
      Closes #18461 and #18739
      
      Co-authored-by: @jackohughes
      8e0446df
    • Arnaud Spiwack's avatar
      LinearTypes => MonoLocalBinds · 188b280d
      Arnaud Spiwack authored
      188b280d
    • Zubin's avatar
      compiler: Force IfGlobalRdrEnv in NFData instance. · 522c12a4
      Zubin authored and Marge Bot's avatar Marge Bot committed
      522c12a4
    • Zubin's avatar
      compiler: Add some strictness annotations to ImportSpec and related constructors · e822ff88
      Zubin authored and Marge Bot's avatar Marge Bot committed
      This prevents us from retaining entire HscEnvs.
      
      Force these ImportSpecs when forcing the GlobalRdrEltX
      
      Adds an NFData instance for Bag
      
      Fixes #24107
      e822ff88
    • Zubin's avatar
      driver: Ensure we force the lookup of old build artifacts before returning the build plan · 8e5745a0
      Zubin authored and Marge Bot's avatar Marge Bot committed
      This prevents us from retaining all previous build artifacts in memory until a
      recompile finishes, instead only retaining the exact artifacts we need.
      
      Fixes #24118
      8e5745a0
    • Zubin's avatar
      driver: Ensure we actually clear the interactive context before reloading · 58d56644
      Zubin authored and Marge Bot's avatar Marge Bot committed
      Previously we called discardIC, but immediately after set the session
      back to an old HscEnv that still contained the IC
      
      Partially addresses #24107
      Fixes #23405
      58d56644
    • Vladislav Zavialov's avatar
      Make forall a keyword (#23719) · d9e4c597
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      Before this change, GHC used to accept `forall` as a term-level
      identifier:
      
      	-- from constraints-0.13
      	forall :: forall p. (forall a. Dict (p a)) -> Dict (Forall p)
      	forall d = ...
      
      Now it is a parse error.
      
      The -Wforall-identifier warning has served its purpose and is now
      a deprecated no-op.
      d9e4c597
  3. Dec 08, 2023
  4. Dec 06, 2023
  5. Nov 30, 2023
    • Krzysztof Gogolewski's avatar
      Kind-check body of a required forall · bd8acc0c
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      We now require that in 'forall a -> ty', ty has kind TYPE r for some r.
      Fixes #24176
      bd8acc0c
    • Alan Zimmerman's avatar
      EPA: EpaDelta for comment has no comments · c7623b22
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      EpaLocation is used to position things. It has two constructors,
      EpaSpan holding a SrcSpan, and EpaDelta with a delta position and a
      possible list of comments.  The comment list is needed because the
      location in EpaDelta has no absolute information to decide which
      comments should be emitted before them when printing.
      
      But it is also used for specifying the position of a comment.  To
      prevent the absurdity of a comment position having a list of comments
      in it, we make EpaLocation parameterisable, using comments for the
      normal case and a constant for within comments.
      
      Updates haddock submodule.
      
      aarch64-darwin
      Metric Decrease:
          MultiLayerModulesTH_OneShot
      c7623b22
  6. Nov 29, 2023
    • Alan Zimmerman's avatar
      EPA: Clean up TC Monad Utils · 99a6a49c
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      We no longer need the alternative variant of addLocM (addLocMA)
      nor wrapLocAM, wrapLocSndMA.
      
      aarch64-darwin
      Metric Increase:
          MultiLayerModulesTH_OneShot
      
      deb10-numa-slow
      Metric Decrease:
          libdir
      99a6a49c
    • Stefan Schulze Frielinghaus's avatar
      llvmGen: Align objects in the data section · dfe1c354
      Stefan Schulze Frielinghaus authored and Marge Bot's avatar Marge Bot committed
      Objects in the data section may be referenced via tagged pointers.
      Thus, align those objects to a 4- or 8-byte boundary for 32- or 64-bit
      platforms, respectively.  Note, this may need to be reconsidered if
      objects with a greater natural alignment requirement are emitted as e.g.
      128-bit atomics.
      
      Fixes #24163.
      dfe1c354
  7. Nov 28, 2023
  8. Nov 27, 2023
  9. Nov 26, 2023
    • Vladislav Zavialov's avatar
      Update Note [hsScopedTvs and visible foralls] · da863d15
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      The Note was written before GHC gained support for visible forall in
      types of terms. Rewrite a few sentences and use a better example.
      da863d15
    • Vladislav Zavialov's avatar
      Term variable capture (#23740) · d1bf25c7
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This patch changes type variable lookup rules (lookupTypeOccRn) and
      implicit quantification rules (filterInScope) so that variables bound
      in the term namespace can be captured at the type level
      
        {-# LANGUAGE RequiredTypeArguments #-}
        f1 x = g1 @x                -- `x` used in a type application
        f2 x = g2 (undefined :: x)  -- `x` used in a type annotation
        f3 x = g3 (type x)          -- `x` used in an embedded type
        f4 x = ...
          where g4 :: x -> x        -- `x` used in a type signature
                g4 = ...
      
      This change alone does not allow us to accept examples shown above,
      but at least it gets them past the renamer.
      d1bf25c7
    • Alan Zimmerman's avatar
      EPA: Remove EpAnnNotUsed · 7902ebf8
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      We no longer need the EpAnnNotUsed constructor for EpAnn, as we can
      represent an unused annotation with an anchor having a EpaDelta of
      zero, and empty comments and annotations.
      
      This simplifies code handling annotations considerably.
      
      Updates haddock submodule
      
      Metric Increase:
          parsing001
      7902ebf8
    • Vladislav Zavialov's avatar
      Add name for -Wdeprecated-type-abstractions (#24154) · 3ede659d
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This warning had no name or flag and was triggered unconditionally.
      Now it is part of -Wcompat.
      3ede659d
  10. Nov 24, 2023
    • Alan Zimmerman's avatar
      EPA: Remove parenthesizeHsType · 34d86315
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      This is called from PostProcess.hs, and adds spurious parens.
      With the looser version of exact printing we had before we could
      tolerate this, as they would be swallowed by the original at the same
      place.
      
      But with the next change (remove EpAnnNotUsed) they result in
      duplicates in the output.
      
      For Darwin build:
      
      Metric Increase:
          MultiLayerModulesTH_OneShot
      34d86315
    • Andreas Klebinger's avatar
      Fix FMA primops generating broken assembly on x86. · fa576eb8
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      `genFMA3Code` assumed that we had to take extra precations to avoid overwriting
      the result of `getNonClobberedReg`. One of these special cases caused a bug resulting
      in broken assembly.
      
      I believe we don't need to hadle these cases specially at all, which means this MR simply
      deletes the special cases to fix the bug.
      
      Fixes #24160
      fa576eb8
  11. Nov 23, 2023
    • Alan Zimmerman's avatar
      EPA: empty tup_tail has noAnn · d2733a05
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      In Parser.y, the tup_tail rule had the following option
                | {- empty -} %shift   { return [Left noAnn] }
      
      Once this works through PostProcess.hs, it means we add an extra
      Missing constructor if the last item was a comma.
      
      Change the annotation type to a Bool to indicate this, and use the
      EpAnn Anchor for the print location for the others.
      d2733a05
    • BinderDavid's avatar
      Unify the hpc testsuites · 121c9ab7
      BinderDavid authored and Marge Bot's avatar Marge Bot committed
      The hpc testsuite was split between testsuite/tests/hpc
      and the submodule libraries/hpc/test. This commit unifies
      the two testsuites in the GHC repository in the directory
      testsuite/tests/hpc.
      121c9ab7
  12. Nov 22, 2023
  13. Nov 20, 2023
    • Alan Zimmerman's avatar
      EPA: Use SrcSpan in EpaSpan · 48bf364e
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      This is more natural, since we already need to deal with invalid
      RealSrcSpans, and that is exactly what SrcSpan.UnhelpfulSpan is for.
      
      Updates haddock submodule.
      48bf364e
  14. Nov 18, 2023
Loading