1. 18 Sep, 2020 5 commits
    • Sylvain Henry's avatar
    • Sylvain Henry's avatar
      Remove pprPrec from Outputable (unused) · 7f2785f2
      Sylvain Henry authored
    • Sylvain Henry's avatar
      Add note about OutputableP · 37aa224a
      Sylvain Henry authored
    • Sylvain Henry's avatar
      Generalize OutputableP · e45c8544
      Sylvain Henry authored
      Add a type parameter for the environment required by OutputableP. It
      avoids tying Platform with OutputableP.
    • Sylvain Henry's avatar
      Introduce OutputableP · ca48076a
      Sylvain Henry authored
      Some types need a Platform value to be pretty-printed: CLabel, Cmm
      types, instructions, etc.
      Before this patch they had an Outputable instance and the Platform value
      was obtained via sdocWithDynFlags. It meant that the *renderer* of the
      SDoc was responsible of passing the appropriate Platform value (e.g. via
      the DynFlags given to showSDoc).  It put the burden of passing the
      Platform value on the renderer while the generator of the SDoc knows the
      Platform it is generating the SDoc for and there is no point passing a
      different Platform at rendering time.
      With this patch, we introduce a new OutputableP class:
         class OutputableP a where
            pdoc :: Platform -> a -> SDoc
      With this class we still have some polymorphism as we have with `ppr`
      (i.e. we can use `pdoc` on a variety of types instead of having a
      dedicated `pprXXX` function for each XXX type).
      One step closer removing `sdocWithDynFlags` (#10143) and supporting
      several platforms (#14335).
  2. 17 Sep, 2020 12 commits
  3. 16 Sep, 2020 5 commits
  4. 15 Sep, 2020 5 commits
    • Ryan Scott's avatar
      Introduce and use DerivClauseTys (#18662) · 4283feaa
      Ryan Scott authored
      This switches `deriv_clause_tys` so that instead of using a list of
      `LHsSigType`s to represent the types in a `deriving` clause, it now
      uses a sum type. `DctSingle` represents a `deriving` clause with no
      enclosing parentheses, while `DctMulti` represents a clause with
      enclosing parentheses. This makes pretty-printing easier and avoids
      confusion between `HsParTy` and the enclosing parentheses in
      `deriving` clauses, which are different semantically.
      Fixes #18662.
    • Sylvain Henry's avatar
      Enhance metrics output · b3143f5a
      Sylvain Henry authored
    • wz1000's avatar
      Export enrichHie from GHC.Iface.Ext.Ast · 0f3884b0
      wz1000 authored
      This is useful for `ghcide`
    • Simon Peyton Jones's avatar
      Care with implicit-parameter superclasses · c7182a5c
      Simon Peyton Jones authored
      Two bugs, #18627 and #18649, had the same cause: we were not
      account for the fact that a constaint tuple might hide an implicit
      The solution is not hard: look for implicit parameters in
      superclasses.  See Note [Local implicit parameters] in
      Then we use this new function in two places
      * The "short-cut solver" in GHC.Tc.Solver.Interact.shortCutSolver
        which simply didn't handle implicit parameters properly at all.
        This fixes #18627
      * The specialiser, which should not specialise on implicit parameters
        This fixes #18649
      There are some lingering worries (see Note [Local implicit
      parameters]) but things are much better.
    • Denis Frezzato's avatar
      Fix rtsopts documentation · 8610bcbe
      Denis Frezzato authored
  5. 14 Sep, 2020 5 commits
  6. 13 Sep, 2020 4 commits
    • Sebastian Graf's avatar
      Hackily decouple the parser from the desugarer · fd5d622a
      Sebastian Graf authored
      In a hopefully temporary hack, I re-used the idea from !1957 of using a
      nullary type family to break the dependency from GHC.Driver.Hooks on the
      definition of DsM ("Abstract Data").
      This in turn broke the last dependency from the parser to the desugarer.
      More details in `Note [The Decoupling Abstract Data Hack]`.
      In the future, we hope to undo this hack again in favour of breaking the
      dependency from the parser to DynFlags altogether.
    • Sebastian Graf's avatar
      Extract definition of DsM into GHC.HsToCore.Types · a77e48d2
      Sebastian Graf authored
      `DsM` was previously defined in `GHC.Tc.Types`, along with `TcM`. But
      `GHC.Tc.Types` is in the set of transitive dependencies of `GHC.Parser`,
      a set which we aim to minimise. Test case `CountParserDeps` checks for
      Having `DsM` in that set means the parser also depends on the innards of
      the pattern-match checker in `GHC.HsToCore.PmCheck.Types`, which is the
      reason we have that module in the first place.
      In the previous commit, we represented the `TyState` by an `InertSet`,
      but that pulls the constraint solver as well as 250 more modules into
      the set of dependencies, triggering failure of `CountParserDeps`.
      Clearly, we want to evolve the pattern-match checker (and the desugarer)
      without being concerned by this test, so this patch includes a small
      refactor that puts `DsM` into its own module.
    • Sebastian Graf's avatar
      Make `tcCheckSatisfiability` incremental (#18645) · 69ea2fee
      Sebastian Graf authored
      By taking and returning an `InertSet`.
      Every new `TcS` session can then pick up where a prior session left with
      Since we don't want to unflatten the Givens (and because it leads to
      infinite loops, see !3971), we introduced a new variant of `runTcS`,
      `runTcSInerts`, that takes and returns the `InertSet` and makes
      sure not to unflatten the Givens after running the `TcS` action.
      Fixes #18645 and #17836.
      Metric Decrease:
    • Théophile Batoz's avatar
      Avoid iterating twice in `zipTyEnv` (#18535) · 2157be52
      Théophile Batoz authored
      zipToUFM is a new function to replace `listToUFM (zipEqual ks vs)`.
      An explicit recursion is preferred due to the sensible nature of fusion.
          T12227 -6.0%
          T12545 -12.3%
          T5030  -9.0%
          T9872a -1.6%
          T9872b -1.6%
          T9872c -2.0%
      Metric Decrease:
  7. 12 Sep, 2020 4 commits
    • Krzysztof Gogolewski's avatar
      Make sure we can read past perf notes · 8440b5fa
      Krzysztof Gogolewski authored
      See #18656.
    • Ryan Scott's avatar
      Don't quote argument to Hadrian's test-env flag (#18656) · 853d121a
      Ryan Scott authored
      Doing so causes the name of the test environment to gain an extra
      set of double quotes, which changes the name entirely.
      Fixes #18656.
    • Ben Gamari's avatar
      hadrian: Pass input file to makeindex · 389a6683
      Ben Gamari authored
      Strangely I find that on Alpine (and apparently only on Alpine) the
      latex makeindex command expects to be given a filename, lest it reads
      from stdin.
    • Sebastian Graf's avatar
      PmCheck: Disattach COMPLETE pragma lookup from TyCons · 2a942285
      Sebastian Graf authored
      By not attaching COMPLETE pragmas with a particular TyCon and instead
      assume that every COMPLETE pragma is applicable everywhere, we can
      drastically simplify the logic that tries to initialise available
      COMPLETE sets of a variable during the pattern-match checking process,
      as well as fixing a few bugs.
      Of course, we have to make sure not to report any of the
      ill-typed/unrelated COMPLETE sets, which came up in a few regression
      In doing so, we fix #17207, #18277 and #14422.
      There was a metric decrease in #18478 by ~20%.
      Metric Decrease: