1. 13 May, 2022 1 commit
  2. 07 Apr, 2022 1 commit
    • Vladislav Zavialov's avatar
      Rename [] to List (#21294) · 02279a9c
      Vladislav Zavialov authored and  Marge Bot's avatar Marge Bot committed
      This patch implements a small part of GHC Proposal #475.
      The key change is in GHC.Types:
      
      	- data [] a = [] | a : [a]
      	+ data List a = [] | a : List a
      
      And the rest of the patch makes sure that List is pretty-printed as []
      in various contexts.
      
      Updates the haddock submodule.
      02279a9c
  3. 21 Mar, 2022 1 commit
  4. 12 Jan, 2022 1 commit
    • sheaf's avatar
      Fix parsing & printing of unboxed sums · 34d8bc24
      sheaf authored and  Marge Bot's avatar Marge Bot committed
      The pretty-printing of partially applied unboxed sums was incorrect,
      as we incorrectly dropped the first half of the arguments, even
      for a partial application such as
      
        (# | #) @IntRep @DoubleRep Int#
      
      which lead to the nonsensical (# DoubleRep | Int# #).
      
      This patch also allows users to write unboxed sum type constructors
      such as
      
        (# | #) :: TYPE r1 -> TYPE r2 -> TYPE (SumRep '[r1,r2]).
      
      Fixes #20858 and #20859.
      34d8bc24
  5. 25 Dec, 2021 1 commit
  6. 25 Nov, 2021 1 commit
    • Krzysztof Gogolewski's avatar
      Misc cleanup · e33412d0
      Krzysztof Gogolewski authored and  Marge Bot's avatar Marge Bot committed
      * Remove `getTag_RDR` (unused), `tidyKind` and `tidyOpenKind`
        (already available as `tidyType` and `tidyOpenType`)
      
      * Remove Note [Explicit Case Statement for Specificity].
        Since 0a709dd9 we require GHC 8.10 for bootstrapping.
      
      * Change the warning to `cmpAltCon` to a panic.
        This shouldn't happen.  If it ever does, the code was wrong anyway:
        it shouldn't always return `LT`, but rather `LT` in one case
        and `GT` in the other case.
      
      * Rename `verifyLinearConstructors` to `verifyLinearFields`
      
      * Fix `Note [Local record selectors]` which was not referenced
      
      * Remove vestiges of `type +v`
      
      * Minor fixes to StaticPointers documentation, part of #15603
      e33412d0
  7. 08 Nov, 2021 1 commit
    • sheaf's avatar
      Default kind vars in tyfams with -XNoPolyKinds · 28334b47
      sheaf authored
        We should still default kind variables in type families
        in the presence of -XNoPolyKinds, to avoid suggesting enabling
        -XPolyKinds just because the function arrow introduced kind variables,
        e.g.
      
          type family F (t :: Type) :: Type where
            F (a -> b) = b
      
        With -XNoPolyKinds, we should still default `r :: RuntimeRep`
        in `a :: TYPE r`.
      
        Fixes #20584
      28334b47
  8. 07 Nov, 2021 1 commit
    • Vladislav Zavialov's avatar
      Print the Type kind qualified when ambiguous (#20627) · 3d7e3d91
      Vladislav Zavialov authored and  Marge Bot's avatar Marge Bot committed
      The Type kind is printed unqualified:
      	ghci> :set -XNoStarIsType
      	ghci> :k (->)
      	(->) :: Type -> Type -> Type
      
      This is the desired behavior unless the user has defined
      their own Type:
      	ghci> data Type
      
      Then we want to resolve the ambiguity by qualification:
      	ghci> :k (->)
      	(->) :: GHC.Types.Type -> GHC.Types.Type -> GHC.Types.Type
      3d7e3d91
  9. 26 Oct, 2021 1 commit
    • sheaf's avatar
      Don't default type variables in type families · 9cc6c193
      sheaf authored and  Marge Bot's avatar Marge Bot committed
        This patch removes the following defaulting of type variables
        in type and data families:
      
          - type variables of kind RuntimeRep defaulting to LiftedRep
          - type variables of kind Levity defaulting to Lifted
          - type variables of kind Multiplicity defaulting to Many
      
        It does this by passing "defaulting options" to the `defaultTyVars`
        function; when calling from `tcTyFamInstEqnGuts` or
        `tcDataFamInstHeader` we pass options that avoid defaulting.
      
        This avoids wildcards being defaulted, which caused type families
        to unexpectedly fail to reduce.
      
        Note that kind defaulting, applicable only with -XNoPolyKinds,
        is not changed by this patch.
      
        Fixes #17536
      
      -------------------------
      Metric Increase:
          T12227
      -------------------------
      9cc6c193
  10. 17 Sep, 2021 1 commit
  11. 10 Jun, 2021 1 commit
  12. 13 May, 2021 2 commits
  13. 04 May, 2021 1 commit
    • Simon Peyton Jones's avatar
      Persist CorePrepProv into IfaceUnivCoProv · 6acadb79
      Simon Peyton Jones authored and  Marge Bot's avatar Marge Bot committed
      CorePrepProv is only created in CorePrep, so I thought it wouldn't be
      needed in IfaceUnivCoProv.  But actually IfaceSyn is used during
      pretty-printing, and we can certainly pretty-print things after
      CorePrep as #19768 showed.
      
      So the simplest thing is to represent CorePrepProv in IfaceSyn.
      
      To improve what Lint can do I also added a boolean to CorePrepProv, to
      record whether it is homogeneously kinded or not. It is introduced in
      two distinct ways (see Note [Unsafe coercions] in GHC.CoreToStg.Prep),
      one of which may be hetero-kinded (e.g. Int ~ Int#) beause it is
      casting a divergent expression; but the other is not.  The boolean
      keeps track.
      6acadb79
  14. 17 Mar, 2021 1 commit
    • Ben Gamari's avatar
      IfaceToType: Ensure that IfaceTyConInfo is shared · 665b757f
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      In #19194 mpickering detailed that there are a LOT of allocations
      of IfaceTyConInfo:
      
      There are just two main cases: IfaceTyConInfo IsPromoted IfaceNormalTyCon
      and IfaceTyConInfo NotPromoted IfaceNormalTyCon. These should be made into
      CAFs and shared. From my analysis, the most common case is
      IfaceTyConInfo NotPromoted IfaceNormalTyCon (53 000)
      then IfaceTyConInfo IsPromoted IfaceNormalTyCon (28 000).
      
      This patch makes it so these are properly shared by using a smart
      constructor.
      
      Fixes #19194.
      665b757f
  15. 09 Mar, 2021 1 commit
    • Ryan Scott's avatar
      Require GHC 8.10 as the minimum compiler for bootstrapping · 0a709dd9
      Ryan Scott authored and  Marge Bot's avatar Marge Bot committed
      Now that GHC 9.0.1 is released, it is time to drop support for bootstrapping
      with GHC 8.8, as we only support building with the previous two major GHC
      releases. As an added bonus, this allows us to remove several bits of CPP that
      are either always true or no longer reachable.
      0a709dd9
  16. 07 Mar, 2021 1 commit
    • Ben Gamari's avatar
      Implement BoxedRep proposal · 3e082f8f
      Ben Gamari authored
      This implements the BoxedRep proposal, refactoring the `RuntimeRep`
      hierarchy from:
      
      ```haskell
      data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ...
      ```
      
      to
      
      ```haskell
      data RuntimeRep = BoxedRep Levity | ...
      data Levity = Lifted | Unlifted
      ```
      
      Updates binary, haddock submodules.
      
      Closes #17526.
      
      Metric Increase:
          T12545
      3e082f8f
  17. 09 Feb, 2021 1 commit
  18. 06 Feb, 2021 1 commit
    • Daniel Rogozin's avatar
      The Char kind (#11342) · 7f3524ef
      Daniel Rogozin authored and  Marge Bot's avatar Marge Bot committed
      
      Co-authored-by: Rinat Striungis's avatarRinat Stryungis <rinat.stryungis@serokell.io>
      
      Implement GHC Proposal #387
      
      * Parse char literals 'x' at the type level
      * New built-in type families CmpChar, ConsSymbol, UnconsSymbol
      * New KnownChar class (cf. KnownSymbol and KnownNat)
      * New SomeChar type (cf. SomeSymbol and SomeNat)
      * CharTyLit support in template-haskell
      
      Updated submodules: binary, haddock.
      
      Metric Decrease:
          T5205
          haddock.base
      
      Metric Increase:
          Naperian
          T13035
      7f3524ef
  19. 22 Jan, 2021 1 commit
    • Sylvain Henry's avatar
      Enhance nested TransCo pretty-printing · 13d876ba
      Sylvain Henry authored and  Marge Bot's avatar Marge Bot committed
      Nested TransCo were printed with a lot of indentation, e.g.:
      
          `cast` (Sub (Sym (Foo.D:R:Index[0] <Bool>_N <'[]>_N)) ; ((Index
                                                                      (Sym (SubDef (<1>_N,
                                                                                    <1>_N)))
                                                                      <'[Bool]>_N)_R ; ...
      
      With this patch we print them as follows:
      
          `cast` (Sub (Sym (Foo.D:R:Index[0] <Bool>_N <'[]>_N))
                  ; (Index (Sym (SubDef (<1>_N, <1>_N))) <'[Bool]>_N)_R
                  ; Sub (Sym (Foo.D:R:Index[1] <1>_N <Int>_N <'[Bool]>_N))
                  ; (Index (Sym (SubDef (<2>_N, <1>_N))) <'[Int, Bool]>_N)_R
      13d876ba
  20. 15 Dec, 2020 1 commit
  21. 14 Dec, 2020 1 commit
    • Andrew Martin's avatar
      Implement BoxedRep proposal · 6c2eb223
      Andrew Martin authored and Ben Gamari's avatar Ben Gamari committed
      This implements the BoxedRep proposal, refacoring the `RuntimeRep`
      hierarchy from:
      
      ```haskell
      data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ...
      ```
      
      to
      
      ```haskell
      data RuntimeRep = BoxedRep Levity | ...
      data Levity = Lifted | Unlifted
      ```
      
      Closes #17526.
      6c2eb223
  22. 01 Nov, 2020 1 commit
  23. 29 Oct, 2020 1 commit
    • Sylvain Henry's avatar
      Split GHC.Driver.Types · 0e9f6def
      Sylvain Henry authored and  Marge Bot's avatar Marge Bot committed
      I was working on making DynFlags stateless (#17957), especially by
      storing loaded plugins into HscEnv instead of DynFlags. It turned out to
      be complicated because HscEnv is in GHC.Driver.Types but LoadedPlugin
      isn't: it is in GHC.Driver.Plugins which depends on GHC.Driver.Types. I
      didn't feel like introducing yet another hs-boot file to break the loop.
      
      Additionally I remember that while we introduced the module hierarchy
      (#13009) we talked about splitting GHC.Driver.Types because it contained
      various unrelated types and functions, but we never executed. I didn't
      feel like making GHC.Driver.Types bigger with more unrelated Plugins
      related types, so finally I bit the bullet and split GHC.Driver.Types.
      
      As a consequence this patch moves a lot of things. I've tried to put
      them into appropriate modules but nothing is set in stone.
      
      Several other things moved to avoid loops.
      
      * Removed Binary instances from GHC.Utils.Binary for random compiler
        things
      * Moved Typeable Binary instances i...
      0e9f6def
  24. 02 Oct, 2020 1 commit
  25. 17 Sep, 2020 1 commit
  26. 23 Aug, 2020 2 commits
  27. 12 Aug, 2020 1 commit
    • Sylvain Henry's avatar
      DynFlags: disentangle Outputable · accbc242
      Sylvain Henry authored and  Marge Bot's avatar Marge Bot committed
      - put panic related functions into GHC.Utils.Panic
      - put trace related functions using DynFlags in GHC.Driver.Ppr
      
      One step closer making Outputable fully independent of DynFlags.
      
      Bump haddock submodule
      accbc242
  28. 06 Aug, 2020 1 commit
  29. 28 Jun, 2020 1 commit
  30. 25 Jun, 2020 1 commit
    • Takenobu Tani's avatar
      Clean up haddock hyperlinks of GHC.* (part2) · 1eb997a8
      Takenobu Tani authored and  Marge Bot's avatar Marge Bot committed
      This updates haddock comments only.
      
      This patch focuses to update for hyperlinks in GHC API's haddock comments,
      because broken links especially discourage newcomers.
      
      This includes the following hierarchies:
      
        - GHC.Iface.*
        - GHC.Llvm.*
      
        - GHC.Rename.*
        - GHC.Tc.*
      
        - GHC.HsToCore.*
        - GHC.StgToCmm.*
        - GHC.CmmToAsm.*
      
        - GHC.Runtime.*
      
        - GHC.Unit.*
        - GHC.Utils.*
        - GHC.SysTools.*
      1eb997a8
  31. 17 Jun, 2020 1 commit
    • Krzysztof Gogolewski's avatar
      Linear types (#15981) · 40fa237e
      Krzysztof Gogolewski authored and Ben Gamari's avatar Ben Gamari committed
      This is the first step towards implementation of the linear types proposal
      (https://github.com/ghc-proposals/ghc-proposals/pull/111).
      
      It features
      
      * A language extension -XLinearTypes
      * Syntax for linear functions in the surface language
      * Linearity checking in Core Lint, enabled with -dlinear-core-lint
      * Core-to-core passes are mostly compatible with linearity
      * Fields in a data type can be linear or unrestricted; linear fields
        have multiplicity-polymorphic constructors.
        If -XLinearTypes is disabled, the GADT syntax defaults to linear fields
      
      The following items are not yet supported:
      
      * a # m -> b syntax (only prefix FUN is supported for now)
      * Full multiplicity inference (multiplicities are really only checked)
      * Decent linearity error messages
      * Linear let, where, and case expressions in the surface language
        (each of these currently introduce the unrestricted variant)
      * Multiplicity-parametric fields
      * Syntax for annotating lambda-bound or let-bound with a multiplicity
      * Syntax for non-linear/multiple-field-multiplicity records
      * Linear projections for records with a single linear field
      * Linear pattern synonyms
      * Multiplicity coercions (test LinearPolyType)
      
      A high-level description can be found at
      https://ghc.haskell.org/trac/ghc/wiki/LinearTypes/Implementation
      Following the link above you will find a description of the changes made to Core.
      This commit has been authored by
      
      * Richard Eisenberg
      * Krzysztof Gogolewski
      * Matthew Pickering
      * Arnaud Spiwack
      
      With contributions from:
      
      * Mark Barbone
      * Alexander Vershilov
      
      Updates haddock submodule.
      40fa237e
  32. 13 Jun, 2020 1 commit
    • Ryan Scott's avatar
      Use HsForAllTelescope to avoid inferred, visible foralls · a31218f7
      Ryan Scott authored and Ben Gamari's avatar Ben Gamari committed
      Currently, `HsForAllTy` permits the combination of `ForallVis` and
      `Inferred`, but you can't actually typecheck code that uses it
      (e.g., `forall {a} ->`). This patch refactors `HsForAllTy` to use a
      new `HsForAllTelescope` data type that makes a type-level distinction
      between visible and invisible `forall`s such that visible `forall`s
      do not track `Specificity`. That part of the patch is actually quite
      small; the rest is simply changing consumers of `HsType` to
      accommodate this new type.
      
      Fixes #18235. Bumps the `haddock` submodule.
      a31218f7
  33. 10 Jun, 2020 2 commits
    • Ömer Sinan Ağacan's avatar
      Cross-module LambdaFormInfo passing · 7a737e89
      Ömer Sinan Ağacan authored and  Marge Bot's avatar Marge Bot committed
      - Store LambdaFormInfos of exported Ids in interface files
      - Use them in importing modules
      
      This is for optimization purposes: if we know LambdaFormInfo of imported
      Ids we can generate more efficient calling code, see `getCallMethod`.
      
      Exporting (putting them in interface files or in ModDetails) and
      importing (reading them from interface files) are both optional. We
      don't assume known LambdaFormInfos anywhere and do not change how we
      call Ids with unknown LambdaFormInfos.
      
      Runtime, allocation, and residency numbers when building
      Cabal-the-library (commit 0d4ee7ba3):
      
      (Log and .hp files are in the MR: !2842)
      
      |     | GHC HEAD | This patch | Diff           |
      |-----|----------|------------|----------------|
      | -O0 |  0:35.89 |    0:34.10 | -1.78s, -4.98% |
      | -O1 |  2:24.01 |    2:23.62 | -0.39s, -0.27% |
      | -O2 |  2:52.23 |    2:51.35 | -0.88s, -0.51% |
      
      |     | GHC HEAD        | This patch      | Diff                       |
      |-----|-----------------|-----------------|------...
      7a737e89
    • Takenobu Tani's avatar
      Clarify leaf module names for new module hierarchy · 24879129
      Takenobu Tani authored and  Marge Bot's avatar Marge Bot committed
      This updates comments only.
      
      This patch replaces leaf module names according to new module
      hierarchy [1][2] as followings:
      
      * Expand leaf names to easily find the module path:
        for instance, `Id.hs` to `GHC.Types.Id`.
      
      * Modify leaf names according to new module hierarchy:
        for instance, `Convert.hs` to `GHC.ThToHs`.
      
      * Fix typo:
        for instance, `GHC.Core.TyCo.Rep.hs` to `GHC.Core.TyCo.Rep`
      
      See also !3375
      
      [1]: https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular
      [2]: ghc/ghc#13009
      24879129
  34. 01 Jun, 2020 3 commits
  35. 21 May, 2020 1 commit
    • Gert-Jan Bottu's avatar
      Explicit Specificity · a9311cd5
      Gert-Jan Bottu authored and  Marge Bot's avatar Marge Bot committed
      Implementation for Ticket #16393.
      Explicit specificity allows users to manually create inferred type variables,
      by marking them with braces.
      This way, the user determines which variables can be instantiated through
      visible type application.
      
      The additional syntax is included in the parser, allowing users to write
      braces in type variable binders (type signatures, data constructors etc).
      This information is passed along through the renamer and verified in the
      type checker.
      The AST for type variable binders, data constructors, pattern synonyms,
      partial signatures and Template Haskell has been updated to include the
      specificity of type variables.
      
      Minor notes:
      - Bumps haddock submodule
      - Disables pattern match checking in GHC.Iface.Type with GHC 8.8
      a9311cd5