1. 19 Oct, 2017 5 commits
    • Ryan Scott's avatar
      Export injectiveVarsOf{Binder,Type} from TyCoRep · de8752e4
      Ryan Scott authored
      Summary:
      I ended up needing to use the functionality of
      `injectiveVarsOfBinder`/`injectiveVarsOfType` in this Haddock PR
      (https://github.com/haskell/haddock/pull/681), but alas, neither of
      these functions were exported. Let's do so.
      
      Test Plan: Does it compile?
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D4107
      de8752e4
    • Ryan Scott's avatar
      Fix #14369 by making injectivity warnings finer-grained · 8846a7fd
      Ryan Scott authored
      Summary:
      Previously, GHC would always raise the possibility that a
      type family might not be injective in certain error messages, even if
      that type family actually //was// injective. Fix this by actually
      checking for a type family's lack of injectivity before emitting
      such an error message.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie
      
      GHC Trac Issues: #14369
      
      Differential Revision: https://phabricator.haskell.org/D4106
      8846a7fd
    • Ryan Scott's avatar
      Error when deriving instances in hs-boot files · 101a8c77
      Ryan Scott authored
      Summary:
      According to the GHC users' guide, one cannot derive
      instances for data types in `.hs-boot` files.
      However, GHC was not enforcing this in practice, which led to
      #14365.
      
      Fix this by actually throwing an error if a derived instance is
      detected in an `.hs-boot` file (and recommend how to fix it in the
      error message.)
      
      Test Plan: make test TEST=T14365
      
      Reviewers: ezyang, austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie
      
      GHC Trac Issues: #14365
      
      Differential Revision: https://phabricator.haskell.org/D4102
      101a8c77
    • Ryan Scott's avatar
      Disable -XRebindableSyntax when running internal GHCi expressions · e023e78b
      Ryan Scott authored
      Summary:
      It's well known that `-XRebindableSyntax` doesn't play
      nicely with some of the internal expressions that GHCi runs. #13385
      was one example where this problem arose, which was fixed at the time
      by simply avoiding the use of `do`-notation in these internal GHCi
      expressions. That seemed to work, but it was a technique that proved
      not to scale, as #14342 demonstrated //another// example where
      `-XRebindableSyntax` can bite.
      
      Instead of delicately arranging the internal GHCi expressions to
      avoid anything that might be covered under `-XRebindableSyntax`,
      this patch takes the much more direct approach of disabling
      `-XRebindableSyntax` entirely when running any internal GHCi
      expression. This shouldn't hurt, since nothing internal to GHCi was
      taking advantage of the extension in the first place, and moreover,
      we can have greater confidence that some other obscure
      `-XRebindableSyntax` corner case won't pop up in the future. As an
      added bonus, this lets us once again use `do`-notation in the code
      that had to be changed when #13385 was (hackily) fixed before.
      
      Test Plan: make test TEST=T14342
      
      Reviewers: bgamari, austin
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14342
      
      Differential Revision: https://phabricator.haskell.org/D4086
      e023e78b
    • Ryan Scott's avatar
      Accept test output for #14350 · 20ae22b0
      Ryan Scott authored
      20ae22b0
  2. 18 Oct, 2017 4 commits
    • Gabor Greif's avatar
      whitespace only · 870020e6
      Gabor Greif authored
      870020e6
    • Gabor Greif's avatar
      Typofix in comment · aba77860
      Gabor Greif authored
      aba77860
    • Simon Peyton Jones's avatar
      Better solving for representational equalities · 5a66d574
      Simon Peyton Jones authored
      This patch adds a bit of extra solving power for representational
      equality constraints to fix Trac #14333
      
      The main changes:
      
      * Fix a buglet in TcType.isInsolubleOccursCheck which wrongly
        reported a definite occurs-check error for (a ~R# b a)
      
      * Get rid of TcSMonad.emitInsolubles.  It had an ad-hoc duplicate-removal
        piece that is better handled in interactIrred, now that insolubles
        are Irreds.
      
        We need a little care to keep inert_count (which does not include
        insolubles) accurate.
      
      * Refactor TcInteract.solveOneFromTheOther, to return a much simpler
        type.  It was just over-complicated before.
      
      * Make TcInteract.interactIrred look for constraints that match
        either way around, in TcInteract.findMatchingIrreds
      
      This wasn't hard and it cleaned up quite a bit of code.
      5a66d574
    • Simon Peyton Jones's avatar
      Don't deeply expand insolubles · 74cd1be0
      Simon Peyton Jones authored
      Trac #13450 went bananas if we expand insoluble constraints.
      Better just to leave them un-expanded.
      
      I'm not sure in detail about why it goes so badly wrong; but
      regardless, the less we mess around with insoluble contraints
      the better the error messages will be.
      74cd1be0
  3. 17 Oct, 2017 3 commits
  4. 16 Oct, 2017 22 commits
  5. 15 Oct, 2017 1 commit
  6. 13 Oct, 2017 1 commit
    • Ryan Scott's avatar
      Delete obsolete docs on GADT interacton with TypeApplications · 2be55b85
      Ryan Scott authored
      Even since ef26182e, this section of
      the users' guide is wrong, as there are no longer special rules for
      the order of type variables in GADT constructors' type signatures
      vis-à-vis visible type application. As a result, this section can
      simply be deleted, as there is no longer anything interesting to say
      about the topic.
      2be55b85
  7. 12 Oct, 2017 4 commits
    • Simon Peyton Jones's avatar
      Re-apply "Typeable: Allow App to match arrow types" · 3de788c4
      Simon Peyton Jones authored
      This re-applies
       commit cc6be3a2
        Author: Ben Gamari <bgamari.foss@gmail.com>
        Date:   Tue Sep 19 18:57:38 2017 -0400
      
          Typeable: Allow App to match arrow types
      
      which was reverted because of Trac #14270.  Now the latter is
      fixed we can re-apply it.
      
      The original ticket was Trac #14236
      3de788c4
    • Simon Peyton Jones's avatar
      Do not bind coercion variables in SpecConstr rules · fb050a33
      Simon Peyton Jones authored
      Trac #14270 showed that SpecConstr could cause nasty Lint failures
      if it generates a RULE that binds coercion varables.  See
      
       * Note [SpecConstr and casts], and
       * the test simplCore/should_compile/T14270.
      
      This doesn't feel like the final word to me, because somehow the
      specialisation "ought" to work.  So I left in a debug WARN to yell if
      the new check acutally fires.
      
      Meanwhile, it stops the erroneous specialisation.
      
      binding coercion
      fb050a33
    • Simon Peyton Jones's avatar
      Add missing T14325.stderr · 15aefb48
      Simon Peyton Jones authored
      15aefb48
    • Simon Peyton Jones's avatar
      Do not quantify over deriving clauses · 82b77ec3
      Simon Peyton Jones authored
      Trac #14331 showed that in a data type decl like
      
         data D = D deriving (C (a :: k))
      
      we were quantifying D over the 'k' in the deriving clause.  Yikes.
      
      Easily fixed, by deleting code in RnTypes.extractDataDefnKindVars
      
      See the discussion on the ticket, esp comment:8.
      82b77ec3