1. 18 May, 2016 1 commit
    • niteria's avatar
      Make inert_model and inert_eqs deterministic sets · fffe3a25
      niteria authored
      The order inert_model and intert_eqs fold affects the order that the
      typechecker looks at things. I've been able to experimentally confirm
      that the order of equalities and the order of the model matter for
      determinism. This is just a straigthforward replacement of
      nondeterministic VarEnv for deterministic DVarEnv.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, goldfire, austin, bgamari, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2232
      
      GHC Trac Issues: #4012
      fffe3a25
  2. 17 May, 2016 1 commit
  3. 16 May, 2016 3 commits
    • niteria's avatar
      Kill varSetElems in tcInferPatSynDecl · 21fe4ffd
      niteria authored
      varSetElems introduces unnecessary non-determinism and while
      I didn't estabilish experimentally that this matters here
      I'm convinced that it will, because I expect pattern synonyms
      to end up in interface files.
      
      Test Plan: ./validate
      
      Reviewers: austin, simonmar, bgamari, mpickering, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2206
      
      GHC Trac Issues: #4012
      21fe4ffd
    • Ben Gamari's avatar
      Move Extension type to ghc-boot-th · eed820b6
      Ben Gamari authored
      This creates a new package, `ghc-boot-th`, to contain the `Extension`
      type, which now lives in `GHC.LanguageExtension.Type`. This ensures that
      the transitive dependency set of the `template-haskell` package remains
      minimal.
      
      The `GHC.LanguageExtensions.Type` module is also re-exported by
      `ghc-boot`, which provides an orphan `binary` instance as well.
      
      Test Plan: Validate
      
      Reviewers: goldfire, thomie, hvr, austin
      
      Reviewed By: thomie
      
      Subscribers: RyanGlScott, thomie, erikd, ezyang
      
      Differential Revision: https://phabricator.haskell.org/D2224
      eed820b6
    • Peter Trommler's avatar
      PPC NCG: Fix pretty printing of st[wd]ux instr. · 2dbdc79b
      Peter Trommler authored
      Printing STU was mixed up. The tab character must appear
      after the 'x'.
      
      Test Plan: validate on powerpc
      
      Reviewers: bgamari, austin, erikd
      
      Reviewed By: austin, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2214
      
      GHC Trac Issues: #12054
      2dbdc79b
  4. 15 May, 2016 1 commit
    • Ömer Sinan Ağacan's avatar
      Fix a performance issue with -fprint-expanded-synonyms · e4834edf
      Ömer Sinan Ağacan authored
      The type synonym expander was doing redundant work by looking at same
      types again and again. This patch fixes the loop code when both of the
      types can be expanded, to do `O(min(n, m))` comparisons and `O(n + m)`
      expansions, where `n` is expansions of the first type and `m` is
      expansions of the second type.
      
      Reported by sjcjoosten in T10547.
      
      Test Plan:
      Added a regression test that was taking several minutes to type check
      before this patch.
      
      Reviewers: bgamari, simonpj, austin, ezyang
      
      Reviewed By: bgamari, simonpj, austin, ezyang
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2198
      
      GHC Trac Issues: #10547
      e4834edf
  5. 12 May, 2016 10 commits
  6. 11 May, 2016 3 commits
    • niteria's avatar
      Document SCC determinism · 3edbd091
      niteria authored
      I've documented the guarantees that stronglyConnCompFromEdgedVertices
      provides and commented on the call sites to explain why they are
      OK from determinism standpoint. I've changed the functions to
      nonDetUFM versions, so that it's explicit they could introduce
      nondeterminism.  I haven't defined container (VarSet, NameSet)
      specific versions, so that we have less functions to worry about.
      
      Test Plan: this is mostly just documentation,
      it should have no runtime effect
      
      Reviewers: bgamari, simonmar, austin, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2194
      
      GHC Trac Issues: #4012
      3edbd091
    • niteria's avatar
      Remove some varSetElems in dsCmdStmt · 0e719885
      niteria authored
      varSetElems introduces unnecessary determinism and it's easy to
      preserve determinism here.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, simonmar, austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2195
      
      GHC Trac Issues: #4012
      0e719885
    • niteria's avatar
      Document why closeOverKind is OK for determinism · 8669c48d
      niteria authored
      There's no point in converting the existing call sites to use
      deterministic closeOverKinds if they never linearize the set.
      
      Test Plan: it compiles, this is basically just documentation
      
      Reviewers: simonpj, goldfire, simonmar, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2191
      
      GHC Trac Issues: #4012
      8669c48d
  7. 10 May, 2016 18 commits
    • niteria's avatar
      Kill foldUFM in classifyTyCon · e207198f
      niteria authored
      We can get away with anyUFM here.
      e207198f
    • niteria's avatar
      Fix typos · 402f201d
      niteria authored
      402f201d
    • niteria's avatar
      Get rid of Traversable UniqFM and Foldable UniqFM · 7e28e47c
      niteria authored
      Both Traversable and Foldable can introduce non-determinism
      and because of typeclass overloading it's implicit and not
      obvious at the call site. This removes the instances, so that
      they can't accidentally be used.
      
      Test Plan: ./validate
      
      Reviewers: austin, goldfire, bgamari, simonmar, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2190
      
      GHC Trac Issues: #4012
      7e28e47c
    • Simon Peyton Jones's avatar
      Use partial-sig constraints as givens · e24b50c3
      Simon Peyton Jones authored
      In TcSimplify.simplifyInfer, use the context of a partial type
      signature as 'givens' when simplifying the inferred constraints of the
      group.  This way we get maximum benefit from them.  See
      Note [Add signature contexts as givens].
      
      This (finally) fixes test EqualityConstraints in Trac #9478.
      
      And it's a nice tidy-up.
      e24b50c3
    • Simon Peyton Jones's avatar
      Add Outputable ShowHowMuch · e7e5939d
      Simon Peyton Jones authored
      I needed this instance when debugging, so I thought I'd add
      it permanently.
      e7e5939d
    • Simon Peyton Jones's avatar
      Comments only · b21e8cc3
      Simon Peyton Jones authored
      b21e8cc3
    • Simon Peyton Jones's avatar
      Comments about static forms · a4717f51
      Simon Peyton Jones authored
      a4717f51
    • niteria's avatar
      Make simplifyInstanceContexts deterministic · b58b0e18
      niteria authored
      simplifyInstanceContexts used cmpType which is nondeterministic
      for canonicalising typeclass constraints in derived instances.
      Following changes make it deterministic as explained by the
      Note [Deterministic simplifyInstanceContexts].
      
      Test Plan: ./validate
      
      Reviewers: simonmar, goldfire, simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2173
      
      GHC Trac Issues: #4012
      b58b0e18
    • niteria's avatar
      Kill unnecessary cmpType in lhs_cmp_type · 4ac0e815
      niteria authored
      This is the only call site of `lhs_cmp_type` and we only
      care about equality.
      `cmpType` is nondeterministic (because `TyCon`s are compared
      with Uniques in `cmpTc`), so if we don't have to use it, it's
      better not to.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, goldfire, bgamari, austin, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2172
      
      GHC Trac Issues: #4012
      4ac0e815
    • Ben Gamari's avatar
      RdrHsSyn: Only suggest `type` qualification when appropriate · e996e85f
      Ben Gamari authored
      This suggestion only applies to operators.
      e996e85f
    • Matthew Pickering's avatar
      Forbid variables to be parents in import lists. · 53f26f5a
      Matthew Pickering authored
      In the long discussion on #11432, it was decided that when a type
      constructor is parsed as a variable ((--.->) is one example) then in
      order to export the type constructor then the user should be required to
      use the ExplicitNamespaces keyword.
      
      This was implemented in quite an indirect manner in the renamer. It
      is much more direct to enforce this in the parser at the expense of
      slighty worse error messages. Further to this, the check in the
      renamer was actually slightly wrong. If the variable was in scope
      then no error was raised, this was causing panics, see #12026 for an
      example.
      
      Reviewers: austin, bgamari
      
      Subscribers: davean, skvadrik, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2181
      
      GHC Trac Issues: #12026
      53f26f5a
    • Simon Peyton Jones's avatar
      Re-do the invariant for TcDepVars · 05974932
      Simon Peyton Jones authored
      Previously I had it so that dv_kvs and dv_tvs didn't
      overlap.  Now they can, and quantifyZonkedTyVars
      removes the former from the latter.  This is more
      economical, and in fact there was a bug where the
      invariant wasn't re-established.
      
      It's much easier to allow dv_kvs and dv_kvs to overlap,
      and to eliminate the overlap in TcMType.quantifyZonkedTyVars
      05974932
    • Simon Peyton Jones's avatar
      Tidy up partial-sig quantification · 9dbf5f5c
      Simon Peyton Jones authored
      There's a messy bit of tcSimplifyInfer which concerns how
      quantify when partial type signatures are involved. This
      patch tidies it up a lot.
      
      Notice that decideQuantification and quantify_tvs get
      much simpler.  And previously the inferred type of a
      function could be cluttered with phantom variables that
      were relevant only to the error messgas.
      
      See Note [Quantification and partial signatures].
      9dbf5f5c
    • Simon Peyton Jones's avatar
      Fix partial sigs and pattern bindings interaction · e1ff2b49
      Simon Peyton Jones authored
      It turns out that GHC 8.0 would accept entirely bogus
      programs like
      
         f2 :: (True, _) -> Char
         Just f2 = Just (\x->x)
      
      (which is now partial-sigs/should_fail/PatBind3)
      
      This also fixes Trac #9478, test `PatBind2`.
      e1ff2b49
    • Simon Peyton Jones's avatar
      Comments only · cc75a5d9
      Simon Peyton Jones authored
      cc75a5d9
    • Simon Peyton Jones's avatar
      Emit wild-card constraints in the right place · 76d9156f
      Simon Peyton Jones authored
      We were failing to emit wild-card hole constraints altogether
      in the case of pattern bindings.  Reason: it was done in
      tcExtendTyVarEnvFromSig, which isn't called for pattern bindings.
      
      This patch make it work right for both pattern and function
      bindings.  Mainly, there is a call to emitWildCardHolds in
      tcRhs for both PatBind and FunBind.
      
      I also killed off TcExpr.typeSigCtxt.
      76d9156f
    • Simon Peyton Jones's avatar
      White space only · 2593e204
      Simon Peyton Jones authored
      2593e204
    • Edward Z. Yang's avatar
      Documentation for simplifyDeriv. · dd3e8470
      Edward Z. Yang authored
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: docs only
      
      Reviewers: simonpj, austin, goldfire, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2180
      dd3e8470
  8. 06 May, 2016 3 commits