1. 07 Aug, 2019 5 commits
    • mniip's avatar
      Add a -fprint-axiom-incomps option (#15546) · 2073745c
      mniip authored
      Supply branch incomps when building an IfaceClosedSynFamilyTyCon
      
      `pprTyThing` now has access to incomps. This also causes them to be
      written out to .hi files, but that doesn't pose an issue other than a
      more faithful bijection between `tyThingToIfaceDecl` and `tcIfaceDecl`.
      
      The machinery for displaying axiom incomps was already present but not
      in use. Since this is now a thing that pops up in ghci's :info the
      format was modified to look like a haskell comment.
      
      Documentation and a test for the new feature included.
      
      Test Plan: T15546
      
      Reviewers: simonpj, bgamari, goldfire
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15546
      
      Differential Revision: https://phabricator.haskell.org/D5097
      2073745c
    • Ömer Sinan Ağacan's avatar
      Introduce a type for "platform word size", use it instead of Int · 6f116005
      Ömer Sinan Ağacan authored
      We introduce a PlatformWordSize type and use it in platformWordSize
      field.
      
      This removes to panic/error calls called when platform word size is not
      32 or 64. We now check for this when reading the platform config.
      6f116005
    • Matthew Pickering's avatar
      Remove old/broken(?) .ghci script · c83e39bf
      Matthew Pickering authored
      I was attempting to load hadrian into ghci by using
      `cabal new-repl exe:hadrian` but it failed because it tried
      to use this `.ghci` configuration.
      
      I'm not sure who used this script but you should really use the new-repl
      method.
      c83e39bf
    • James Foster's avatar
      hadrian: Refactor file patterns for future Shake changes (fixes #17005) · 0c1ccf3c
      James Foster authored
      Shake will be moving from its current implementation of ?== to one from
      System.FilePattern. Support for `//` is being dropped, leaving only `*`
      and `**` as special forms. This commit converts the existing file
      patterns in Hadrian to the new format. It also removes all occurances
      of <//> and changes the user-settings docs to remove references to //
      and add **.
      
      The conversion is as follows:
      
      - //a ==> **/a
      
      - a// ==> a/**
      
      - a//b ==> a/**/b
      0c1ccf3c
    • Simon Peyton Jones's avatar
      ea16f6cb
  2. 04 Aug, 2019 6 commits
    • Ben Gamari's avatar
      testsuite: Rework tracking of fragile tests · 6e5dfcd2
      Ben Gamari authored
      Breaks fragile tests into two groups, allowing us to easily preserve
      stdout/stderr of failing fragile tests.
      6e5dfcd2
    • Ben Gamari's avatar
      configure: Search for LLVM executables with two-number versions · 2e031806
      Ben Gamari authored
      Fedora uses the naming llc-7.0 while Debian uses llc-7. Ensure that both
      are found.
      
      Fixes #16990.
      2e031806
    • Ben Gamari's avatar
      testsuite: Add testsuite for #16978 · 3b31a94d
      Ben Gamari authored
      3b31a94d
    • Simon Peyton Jones's avatar
      Don't float unlifted join points to top level · 7d8d0012
      Simon Peyton Jones authored
      Ticket #16978 showed that we were floating a recursive,
      unlifted join point to top level.  It's very much a corner
      case:
      
          joinrec j :: Int#
                  j = jump j
          in ...
      
      But somehow it showed up in a real program.
      
      For non-recursive bindings in SetLevels.lvlBind we were already
      (correctly) checking for unlifted bindings, but when I wrote
      that code I didn't think that a /recursive/ binding could be
      unlifted but /join-points/ can be!
      
      Actually I don't think that SetLevels should be floating
      join points at all.  SetLevels really floats things to move
      stuff out of loops and save allocation; but none of that applies
      to join points.  The only reason to float join points is in
      cases like
         join j1 x = join j2 y = ...
                     in ...
      which we might want to swizzle to
         join j2 x y = ... in
         join j1 x = ...
         in ...
      because now j1 looks small and might be inlined away altogether.
      But this is a very local float perhaps better done in the simplifier.
      
      Still: this patch fixes the crash, and does so in a way that is
      harmless if/when we change our strategy for floating join points.
      7d8d0012
    • Matthew Pickering's avatar
      Update .gitignore · 8a061d18
      Matthew Pickering authored
      Add some files generated by hadrian and some tooling files
      8a061d18
    • Ben Gamari's avatar
      gitlab-ci: Manually set SPHINXBUILD on Windows · 7e404afd
      Ben Gamari authored
      For some reason configure seems unable to find it on its own. Let's try
      giving it a hint.
      
      Addresses #16398.
      7e404afd
  3. 03 Aug, 2019 5 commits
  4. 02 Aug, 2019 5 commits
    • Adam Sandberg Eriksson's avatar
      5e960287
    • Krzysztof Gogolewski's avatar
      Remove build.nix.sh · c902f56b
      Krzysztof Gogolewski authored
      This file refers to shell.nix, which was removed in
      430e6fed and c00d2f59.
      c902f56b
    • Ryan Scott's avatar
      Use injectiveVarsOfType to catch dodgy type family instance binders (#17008) · 93bed40a
      Ryan Scott authored
      Previously, we detected dodgy type family instances binders by
      expanding type synonyms (via `exactTyCoVarsOfType`) and looking for
      type variables on the RHS that weren't mentioned on the (expanded)
      LHS. But this doesn't account for type families (like the example
      in #17008), so we instead use `injectiveVarsOfType` to only count
      LHS type variables that are in injective positions. That way, the `a`
      in `type instance F (x :: T a) = a` will not count if `T` is a type
      synonym _or_ a type family.
      
      Along the way, I moved `exactTyCoVarsOfType` to `TyCoFVs` to live
      alongside its sibling functions that also compute free variables.
      
      Fixes #17008.
      93bed40a
    • Ryan Scott's avatar
      Rip out 9-year-old pattern variable hack (#17007) · 1b9d32b8
      Ryan Scott authored
      GHC had an ad hoc validity check in place to rule out pattern
      variables bound by type synonyms, such as in the following example:
      
      ```hs
      type ItemColID a b = Int  -- Discards a,b
      
      get :: ItemColID a b -> ItemColID a b
      get (x :: ItemColID a b) = x :: ItemColID a b
      ```
      
      This hack is wholly unnecessary nowadays, since OutsideIn(X) is more
      than capable of instantiating `a` and `b` to `Any`. In light of this,
      let's rip out this validity check.
      
      Fixes #17007.
      1b9d32b8
    • Andreas Klebinger's avatar
      Add StandaloneDeriving example for DerivingVia. · 95521140
      Andreas Klebinger authored
      [skip-ci]
      95521140
  5. 01 Aug, 2019 1 commit
    • Ivan Kasatenko's avatar
      Fix T16916 CI failures (#16966) · 986643cb
      Ivan Kasatenko authored
      1. Slightly increased the waiting time for the tested effect to be more
         profound.
      
      2. Introduced measuring of the actual time spent waiting and adjusing
         CPU time by it to compensate for threadDelay waiting time
         inconsistencies.
      986643cb
  6. 31 Jul, 2019 5 commits
    • Ben Gamari's avatar
      gitlab-ci: Fix it after upgrade · 5e04841c
      Ben Gamari authored
      It seems that the regular expression parser changed in GitLab 12.1 and
      now does now support forward slashes in the RE, even when escaped.
      5e04841c
    • Ben Gamari's avatar
      Work around redundant import issue · 787fab43
      Ben Gamari authored
      As mentioned in #16997, GHC currently complains about this import.
      In general I'm reluctant to paper over things like this but in the case
      of an hs-boot file I think adding an import list is the right thing to
      do regardless of the bug.
      787fab43
    • Ben Gamari's avatar
      Move tyConAppNeedsKindSig to Type · 88410e77
      Ben Gamari authored
      Previously it was awkwardly in TyCoFVs (and before that in TyCoRep).
      Type seems like a sensible place for it to live.
      88410e77
    • Ben Gamari's avatar
      gitignore: Add .mypy_cache · b6fa7fe3
      Ben Gamari authored
      b6fa7fe3
    • Ben Gamari's avatar
      Break up TyCoRep · 371dadfb
      Ben Gamari authored
      This breaks up the monstrous TyCoReps module into several new modules by
      topic:
      
       * TyCoRep: Contains the `Coercion`, `Type`, and related type
         definitions and a few simple predicates but nothing further
      
       * TyCoPpr: Contains the the pretty-printer logic
      
       * TyCoFVs: Contains the free variable computations (and
         `tyConAppNeedsKindSig`, although I suspect this should change)
      
       * TyCoSubst: Contains the substitution logic for types and coercions
      
       * TyCoTidy: Contains the tidying logic for types
      
      While we are able to eliminate a good number of `SOURCE` imports (and
      make a few others smaller) with this change, we must introduce one new
      `hs-boot` file for `TyCoPpr` so that `TyCoRep` can define `Outputable`
      instances for the types it defines.
      
      Metric Increase:
          haddock.Cabal
          haddock.compiler
      371dadfb
  7. 30 Jul, 2019 2 commits
  8. 29 Jul, 2019 2 commits
  9. 28 Jul, 2019 2 commits
  10. 26 Jul, 2019 6 commits
    • Alex D's avatar
      Add regression test for #16946 · 26314386
      Alex D authored
      26314386
    • Adam Sandberg Eriksson's avatar
      7c9fb2f0
    • Vladislav Zavialov's avatar
      ea08fa37
    • Vladislav Zavialov's avatar
      TemplateHaskell: reifyType (#16976) · 00d9d284
      Vladislav Zavialov authored
      00d9d284
    • Alex D's avatar
      Change behaviour of -ddump-cmm-verbose to dump each Cmm pass output to a... · aae0457f
      Alex D authored
      Change behaviour of -ddump-cmm-verbose to dump each Cmm pass output to a separate file and add -ddump-cmm-verbose-by-proc to keep old behaviour (#16930)
      aae0457f
    • Ryan Scott's avatar
      Banish reportFloatingViaTvs to the shadow realm (#15831, #16181) · 30b6f391
      Ryan Scott authored
      GHC used to reject programs of this form:
      
      ```
      newtype Age = MkAge Int
        deriving Eq via Const Int a
      ```
      
      That's because an earlier implementation of `DerivingVia` would
      generate the following instance:
      
      ```
      instance Eq Age where
        (==) = coerce @(Const Int a -> Const Int a -> Bool)
                      @(Age         -> Age         -> Bool)
                      (==)
      ```
      
      Note that the `a` in `Const Int a` is not bound anywhere, which
      causes all sorts of issues. I figured that no one would ever want to
      write code like this anyway, so I simply banned "floating" `via` type
      variables like `a`, checking for their presence in the aptly named
      `reportFloatingViaTvs` function.
      
      `reportFloatingViaTvs` ended up being implemented in a subtly
      incorrect way, as #15831 demonstrates. Following counsel with the
      sage of gold fire, I decided to abandon `reportFloatingViaTvs`
      entirely and opt for a different approach that would _accept_
      the instance above. This is because GHC now generates this instance
      instead:
      
      ```
      instance forall a. Eq Age where
        (==) = coerce @(Const Int a -> Const Int a -> Bool)
                      @(Age         -> Age         -> Bool)
                      (==)
      ```
      
      Notice that we now explicitly quantify the `a` in
      `instance forall a. Eq Age`, so everything is peachy scoping-wise.
      See `Note [Floating `via` type variables]` in `TcDeriv` for the full
      scoop.
      
      A pleasant benefit of this refactoring is that it made it much easier
      to catch the problem observed in #16181, so this patch fixes that
      issue too.
      
      Fixes #15831. Fixes #16181.
      30b6f391
  11. 25 Jul, 2019 1 commit
    • Ömer Sinan Ağacan's avatar
      Printer: add an empty line between bindings in Rec STG binding groups · b9c99df1
      Ömer Sinan Ağacan authored
      Before:
      
          Rec {
          x2_r10T :: Lib.Bar
          [GblId, Unf=OtherCon []] =
              CCS_DONT_CARE Lib.Bar! [x3_r10U];
          x3_r10U :: Lib.Foo
          [GblId, Unf=OtherCon []] =
              CCS_DONT_CARE Lib.Foo! [x1_r10p x2_r10T];
          end Rec }
      
      After:
      
          Rec {
          x2_r10T :: Lib.Bar
          [GblId, Unf=OtherCon []] =
              CCS_DONT_CARE Lib.Bar! [x3_r10U];
      
          x3_r10U :: Lib.Foo
          [GblId, Unf=OtherCon []] =
              CCS_DONT_CARE Lib.Foo! [x1_r10p x2_r10T];
          end Rec }
      b9c99df1