Skip to content
Snippets Groups Projects
  1. Jan 01, 2024
  2. Dec 25, 2023
  3. Dec 24, 2023
  4. Dec 20, 2023
  5. Dec 15, 2023
  6. Dec 13, 2023
  7. 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
    • 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
  8. Nov 26, 2023
  9. Nov 21, 2023
  10. Nov 17, 2023
  11. Nov 16, 2023
  12. Nov 15, 2023
  13. Nov 09, 2023
  14. Nov 03, 2023
    • Vladislav Zavialov's avatar
      T2T in Expressions (#23738) · 0dfb1fa7
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This patch implements the T2T (term-to-type) transformation in
      expressions. Given a function with a required type argument
      	vfun :: forall a -> ...
      
      the user can now call it as
      	vfun (Maybe Int)
      
      instead of
      	vfun (type (Maybe Int))
      
      The Maybe Int argument is parsed and renamed as a term (HsExpr), but then
      undergoes a conversion to a type (HsType).
      See the new function expr_to_type in compiler/GHC/Tc/Gen/App.hs
      and Note [RequiredTypeArguments and the T2T mapping]
      
      Left as future work: checking for puns.
      0dfb1fa7
    • Jaro Reinders's avatar
      Add NCG support for common 64bit operations to the x86 backend. · 6755d833
      Jaro Reinders authored and Andreas Klebinger's avatar Andreas Klebinger committed
      These used to be implemented via C calls which was obviously quite bad
      for performance for operations like simple addition.
      
      Co-authored-by: Andreas Klebinger
      6755d833
  15. Nov 01, 2023
    • Ryan Scott's avatar
      More robust checking for DataKinds · 9f9c9227
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      As observed in #22141, GHC was not doing its due diligence in catching code
      that should require `DataKinds` in order to use. Most notably, it was allowing
      the use of arbitrary data types in kind contexts without `DataKinds`, e.g.,
      
      ```hs
      data Vector :: Nat -> Type -> Type where
      ```
      
      This patch revamps how GHC tracks `DataKinds`. The full specification is
      written out in the `DataKinds` section of the GHC User's Guide, and the
      implementation thereof is described in `Note [Checking for DataKinds]` in
      `GHC.Tc.Validity`. In brief:
      
      * We catch _type_-level `DataKinds` violations in the renamer. See
        `checkDataKinds` in `GHC.Rename.HsType` and `check_data_kinds` in
        `GHC.Rename.Pat`.
      
      * We catch _kind_-level `DataKinds` violations in the typechecker, as this
        allows us to catch things that appear beneath type synonyms. (We do *not*
        want to do this in type-level contexts, as it is perfectly fine for a type
        synonym to mention something that requires DataKinds while still using the
        type synonym in a module that doesn't enable DataKinds.) See `checkValidType`
        in `GHC.Tc.Validity`.
      
      * There is now a single `TcRnDataKindsError` that classifies all manner of
        `DataKinds` violations, both in the renamer and the typechecker. The
        `NoDataKindsDC` error has been removed, as it has been subsumed by
        `TcRnDataKindsError`.
      
      * I have added `CONSTRAINT` is `isKindTyCon`, which is what checks for illicit
        uses of data types at the kind level without `DataKinds`. Previously,
        `isKindTyCon` checked for `Constraint` but not `CONSTRAINT`. This is
        inconsistent, given that both `Type` and `TYPE` were checked by `isKindTyCon`.
        Moreover, it thwarted the implementation of the `DataKinds` check in
        `checkValidType`, since we would expand `Constraint` (which was OK without
        `DataKinds`) to `CONSTRAINT` (which was _not_ OK without `DataKinds`) and
        reject it. Now both are allowed.
      
      * I have added a flurry of additional test cases that test various corners of
        `DataKinds` checking.
      
      Fixes #22141.
      9f9c9227
    • Krzysztof Gogolewski's avatar
      docs: fix ScopedTypeVariables example (#24101) · 7a90020f
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      The previous example didn't compile.
      
      Furthermore, it wasn't demonstrating the point properly.
      I have changed it to an example which shows that 'a' in the signature
      must be the same 'a' as in the instance head.
      7a90020f
  16. Oct 24, 2023
  17. Oct 23, 2023
  18. Oct 22, 2023
    • Cheng Shao's avatar
      rts: drop stale mentions of MIN_UPD_SIZE · c1e3719c
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      We used to have MIN_UPD_SIZE macro that describes the minimum reserved
      size for thunks, so that the thunk can be overwritten in place as
      indirections or blackholes. However, this macro has not been actually
      defined or used anywhere since a long time ago; StgThunkHeader already
      reserves a padding word for this purpose. Hence this patch which drops
      stale mentions of MIN_UPD_SIZE.
      c1e3719c
    • John Ericson's avatar
      Get rid of all mention of `mk/config.h` · 7dfcab2f
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      The RTS configure script is now solely responsible for managing its
      headers; the top level configure script does not help.
      7dfcab2f
  19. Oct 14, 2023
  20. Oct 10, 2023
  21. Oct 04, 2023
  22. Sep 30, 2023
  23. Sep 27, 2023
  24. Sep 26, 2023
  25. Sep 19, 2023
  26. Sep 16, 2023
  27. Sep 12, 2023
    • Matthew Pickering's avatar
      Add -Winconsistent-flags warning · 21a906c2
      Matthew Pickering authored and Krzysztof Gogolewski's avatar Krzysztof Gogolewski committed
      The warning fires when inconsistent command line flags are passed.
      
      For example:
      
      * -dynamic-too and -dynamic
      * -dynamic-too on windows
      * -O and --interactive
      * etc
      
      This is on by default and allows users to control whether the warning is
      displayed and whether it should be an error or not.
      
      Fixes #22572
      21a906c2
    • Teo Camarasu's avatar
      Add changelog entry for #23340 · 2b07bf2e
      Teo Camarasu authored and Marge Bot's avatar Marge Bot committed
      2b07bf2e
    • Teo Camarasu's avatar
      nonmoving: introduce a family of dense allocators · f367835c
      Teo Camarasu authored and Marge Bot's avatar Marge Bot committed
      Supplement the existing power 2 sized nonmoving allocators with a family
      of dense allocators up to a configurable threshold.
      
      This should reduce waste from rounding up block sizes while keeping the
      amount of allocator sizes manageable.
      
      This patch:
        - Adds a new configuration option `--nonmoving-dense-allocator-count`
          to control the amount of these new dense allocators.
        - Adds some constants to `NonmovingAllocator` in order to keep
          marking fast with the new allocators.
      
      Resolves #23340
      f367835c
    • Teo Camarasu's avatar
      docs: move -xn flag beside --nonmoving-gc · 98166389
      Teo Camarasu authored and Marge Bot's avatar Marge Bot committed
      It makes sense to have these beside each other as they are aliases.
      98166389
  28. Sep 09, 2023
Loading