1. 13 Oct, 2015 5 commits
    • Ömer Sinan Ağacan's avatar
      Fix incorrect import warnings when methods with identical names are imported · 1818b48e
      Ömer Sinan Ağacan authored
      Currently, GHC's warning generation code is assuming that a name (`RdrName`)
      can be imported at most once. This is a correct assumption, because 1) it's OK
      to import same names as long as we don't use any of them 2) when we use one of
      them, GHC generates an error because it doesn't disambiguate it automatically.
      
      But apparently the story is different with typeclass methods. If I import two
      methods with same names, it's OK to use them in typeclass instance
      declarations, because the context specifies which one to use. For example, this
      is OK (where modules A and B define typeclasses A and B, both with a function
      has),
      
          import A
          import B
      
          data Blah = Blah
      
          instance A Blah where
            has = Blah
      
          instance B Blah where
            has = Blah
      
      But GHC's warning generator is not taking this into account, and so if I change
      import list of this program to:
      
          import A (A (has))
          import B (B (has))
      
      GHC is printing these warnings:
      
          Main.hs:5:1: Warning:
              The import of ‘A.has’ from module ‘A’ is redundant
      
          Main.hs:6:1: Warning:
              The import of ‘B.has’ from module ‘B’ is redundant
      
      Why? Because warning generation code is _silently_ ignoring multiple symbols
      with same names.
      
      With this patch, GHC takes this into account. If there's only one name, then
      this patch reduces to the previous version, that is, it works exactly the same
      as current GHC (thanks goes to @quchen for realizing this).
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D1257
      
      GHC Trac Issues: #10890
      1818b48e
    • Ryan Scott's avatar
      Make dataToQa aware of Data instances which use functions to implement toConstr · d2f9972a
      Ryan Scott authored
      Trac #10796 exposes a way to make `template-haskell`'s `dataToQa` function
      freak out if using a `Data` instance that produces a `Constr` (by means of
      `toConstr`) using a function name instead of a data constructor name. While
      such `Data` instances are somewhat questionable, they are nevertheless present
      in popular libraries (e.g., `containers`), so we can at least make `dataToQa`
      aware of their existence.
      
      In order to properly distinguish strings which represent variables (as opposed
      to data constructors), it was necessary to move functionality from `Lexeme` (in
      `ghc`) to `GHC.Lexeme` in a new `ghc-boot` library (which was previously named
      `bin-package-db`).
      
      Reviewed By: goldfire, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1313
      
      GHC Trac Issues: #10796
      d2f9972a
    • bernalex's avatar
      Slightly wibble TcSimplify documentation · 94ef79a7
      bernalex authored
      Add some commas, fix some typos, etc.
      Signed-off-by: bernalex's avatarAlexander Berntsen <alexander@plaimi.net>
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D1321
      94ef79a7
    • Austin Seipp's avatar
      testsuite: attempt fixing T10935 output · 330ba6ad
      Austin Seipp authored
      This fallout was caused by f8fbf385 (see #10935), and looks easy
      enough, but admittedly I just tried patching the output, so we're doing it
      live.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      330ba6ad
    • afarmer's avatar
      Don't inline/apply other rules when simplifying a rule RHS. · dcc34287
      afarmer authored
      HERMIT users depend on RULES to specify equational properties. 7.10.2
      performed both inlining and simplification in both sides of the rules, meaning
      they can't really be used for this. This breaks most HERMIT use cases.  A
      separate commit already disabled this for the LHS of rules. This does so for
      the RHS.
      
      See Trac #10829 for nofib results.
      
      Reviewed By: austin, bgamari, simonpj
      
      Differential Revision: https://phabricator.haskell.org/D1246
      
      GHC Trac Issues: #10829
      dcc34287
  2. 12 Oct, 2015 5 commits
    • Simon Peyton Jones's avatar
      Reinstate monomorphism-restriction warnings · f8fbf385
      Simon Peyton Jones authored
      This patch is driven by Trac #10935, and reinstates the
      -fwarn-monomorphism-restriction warning.  It was first lost in 2010:
      d2ce0f52 "Super-monster patch implementing the new typechecker -- at
      last"
      
      I think the existing documentation is accurate; it is not even
      turned on by -Wall.
      
      I added one test.
      f8fbf385
    • Simon Peyton Jones's avatar
      Test Trac #10931 · 6b7bad92
      Simon Peyton Jones authored
      6b7bad92
    • Herbert Valerio Riedel's avatar
      base: MRP-refactoring of AMP instances · e737a512
      Herbert Valerio Riedel authored
      This refactors `(>>)`/`(*>)`/`return`/`pure` methods into normal form.
      
      The redundant explicit `return` method definitions are dropped
      altogether.
      
      The explicit `(>>) = (*>)` definitions can't be removed yet, as
      the default implementation of `(>>)` is still in terms of `(*>)`
      (even though that should have been changed according to the AMP but
      wasn't -- see note in GHC.Base for details why this had to be postponed)
      
      A nofib comparision shows this refactoring to result in minor runtime
      improvements (unless those are within normal measurement fluctuations):
      
              Program           Size    Allocs   Runtime   Elapsed  TotalMem
        -------------------------------------------------------------------------
                  Min          -0.0%     -0.0%     -1.6%     -3.9%     -1.1%
                  Max          -0.0%     +0.0%     +0.5%     +0.5%      0.0%
        Geometric Mean         -0.0%     -0.0%     -0.4%     -0.5%     -0.0%
      
      Full `nofib` report at https://phabricator.haskell.org/P68
      
      Reviewers: quchen, alanz, austin, #core_libraries_committee, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1316
      e737a512
    • Erik de Castro Lopo's avatar
      PPC: Fix right shift by 32 bits #10870 · 4bd58c17
      Erik de Castro Lopo authored
      Summary: Test included.
      
      Test Plan: Run test T10870.hs on X86/X86_64/Arm/Arm64 etc
      
      Reviewers: bgamari, nomeata, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1322
      
      GHC Trac Issues: #10870
      4bd58c17
    • Erik de Castro Lopo's avatar
      f0023409
  3. 10 Oct, 2015 7 commits
  4. 09 Oct, 2015 6 commits
  5. 08 Oct, 2015 5 commits
  6. 07 Oct, 2015 2 commits
  7. 06 Oct, 2015 7 commits
  8. 05 Oct, 2015 2 commits
  9. 04 Oct, 2015 1 commit