1. 18 Oct, 2017 2 commits
    • 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
  2. 17 Oct, 2017 3 commits
    • Joachim Breitner's avatar
      Improve user’s guide around deriving · 317aa966
      Joachim Breitner authored
      In particular:
       * add an intro to “10.6. Extensions to the “deriving” mechanism” giving
         an overview,
       * make the various sections on `-XDerivingFoo` subsections of
         “10.6.3. Deriving instances of extra classes (Data, etc.)”
       * Move the reference anchors for the various `DerivingFoo` extensions
         to a more appropriate spot.
       * Add subsection “10.6.6.1. Default deriving strategy” to the
         deriving section (#14357)
      317aa966
    • Gabor Greif's avatar
      Fix grammaros in comments · 2f436151
      Gabor Greif authored
      2f436151
    • Gabor Greif's avatar
      Simplify, no functionality change · ed48d133
      Gabor Greif authored
      ed48d133
  3. 16 Oct, 2017 22 commits
  4. 15 Oct, 2017 1 commit
  5. 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
  6. 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
  7. 11 Oct, 2017 7 commits
    • Simon Peyton Jones's avatar
      Add a missing zonk in TcDerivInfer.simplifyDeriv · 13fdca3d
      Simon Peyton Jones authored
      I'm astonished that anything worked without this!
      
      Fixes Trac #14339
      13fdca3d
    • Simon Peyton Jones's avatar
      Avoid creating dependent types in FloatOut · 4bb54a45
      Simon Peyton Jones authored
      This bug was exposed by Trac #14270.  The problem and its cure
      is described in SetLevels, Note [Floating and kind casts].
      
      It's simple and will affect very few programs.  But the very
      fact that it was so unexpected is discomforting.
      4bb54a45
    • Alan Zimmerman's avatar
      Pretty-printing of derived multi-parameter classes omits parentheses · 6869864e
      Alan Zimmerman authored
      Summary:
      Pretty printing a splice with an HsAppType in the deriving clause, such as
      
          $([d| data Foo a = Foo a deriving (C a) |])
      
      would omit the parens.
      
      Test Plan: ./validate
      
      Reviewers: RyanGlScott, austin, bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14289
      
      Differential Revision: https://phabricator.haskell.org/D4056
      6869864e
    • Ryan Scott's avatar
      Fix #10816 by renaming FixitySigs more consistently · 9c3f7316
      Ryan Scott authored
      Summary:
      #10816 surfaced because we were renaming top-level fixity
      declarations with a different code path (`rnSrcFixityDecl`) than
      the code path for fixity declarations inside of type classes, which
      is not privy to names that exist in the type namespace. Luckily, the
      fix is simple: use `rnSrcFixityDecl` in both places.
      
      Test Plan: make test TEST=T10816
      
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie
      
      GHC Trac Issues: #10816
      
      Differential Revision: https://phabricator.haskell.org/D4077
      9c3f7316
    • Simon Peyton Jones's avatar
      Remove wc_insol from WantedConstraints · f20cf982
      Simon Peyton Jones authored
      This patch is a pure refactoring, which I've wanted to do for
      some time.  The main payload is
      
      * Remove the wc_insol field from WantedConstraints;
        instead put all the insolubles in wc_simple
      
      * Remove inert_insols from InertCans
        Instead put all the insolubles in inert_irreds
      
      * Add a cc_insol flag to CIrredCan, to record that
        the constraint is definitely insoluble
      
      Reasons
      
      * Quite a bit of code gets slightly simpler
      * Fewer concepts to keep separate
      * Insolubles don't happen at all in production code that is
        just being recompiled, so previously there was a lot of
        moving-about of empty sets
      
      A couple of error messages acutally improved.
      f20cf982
    • Simon Peyton Jones's avatar
      Delete two unused functions · 3e44562a
      Simon Peyton Jones authored
      Delete unused functions
             pprArrowChain
             pprPrefixApp
      
      from TyCoRep
      3e44562a
    • Simon Peyton Jones's avatar
      Change "cobox" to "co" in debug output · 79ae03aa
      Simon Peyton Jones authored
      These coercions are /not/ boxed, so "cobox" is positively misleading.
      And it's longer than necessary.
      79ae03aa