1. 05 Jan, 2018 1 commit
  2. 04 Jan, 2018 6 commits
    • Simon Peyton Jones's avatar
      Fix deep, dark corner of pattern synonyms · 307d1dfe
      Simon Peyton Jones authored
      Trac #14552 showed a very obscure case where we can't infer a
      good pattern-synonym type.
      
      The error message is horrible, but at least we no longer crash
      and burn.
      307d1dfe
    • Simon Peyton Jones's avatar
      comments only · 86ea3b1e
      Simon Peyton Jones authored
      86ea3b1e
    • Simon Peyton Jones's avatar
      Stop double-stacktrace in ASSERT failures · e2998d72
      Simon Peyton Jones authored
      We were getting the stack trace printed twice in assertion
      failures (e.g. see the Description of Trac #14552).
      
      This fixes it, by deleting code.
      
      (c.f. Trac #14635 which reports the same bug in documentation).
      e2998d72
    • Simon Peyton Jones's avatar
      Drop dead Given bindings in setImplicationStatus · 954cbc7c
      Simon Peyton Jones authored
      Trac #13032 pointed out that we sometimes generate unused
      bindings for Givens, and (worse still) we can't always discard
      them later (we don't drop a case binding unless we can prove
      that the scrutinee is non-bottom.
      
      It looks as if this may be a major reason for the performace
      problems in #14338 (see comment:29).
      
      This patch fixes the problem at source, by pruning away all the
      dead Givens.  See Note [Delete dead Given evidence bindings]
      
      Remarkably, compiler allocation falls by 23% in
      perf/compiler/T12227!
      
      I have not confirmed whether this change actualy helps with
      954cbc7c
    • niteria's avatar
      Cache the number of data cons in DataTyCon and SumTyCon · 6c348244
      niteria authored
      This is a follow-up after faf60e85 - Make tagForCon non-linear.
      On the mailing list @simonpj suggested to solve the
      linear behavior by caching the sizes.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, simonmar, bgamari, austin
      
      Reviewed By: simonpj
      
      Subscribers: carter, goldfire, rwbarton, thomie, simonpj
      
      Differential Revision: https://phabricator.haskell.org/D4131
      6c348244
    • Ryan Scott's avatar
      Make typeToLHsType produce kind signatures for tycon applications · 649e7772
      Ryan Scott authored
      Summary:
      `GeneralizedNewtypeDeriving` generates calls to `coerce`
      which take visible type arguments. These types must be produced by
      way of `typeToLHsType`, which converts a `Type` to an `LHsType`.
      However, `typeToLHsType` was leaving off important kind information
      when a `Type` contained a poly-kinded tycon application, leading to
      incorrectly generated code in #14579.
      
      This fixes the issue by tweaking `typeToLHsType` to generate
      explicit kind signatures for tycon applications. This makes the
      generated code noisier, but at least the program from #14579 now
      works correctly.
      
      Test Plan: make test TEST=T14579
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14579
      
      Differential Revision: https://phabricator.haskell.org/D4264
      649e7772
  3. 03 Jan, 2018 10 commits
  4. 02 Jan, 2018 11 commits
    • Matthew Pickering's avatar
      Rename HEq_sc and Coercible_sc to heq_sel and coercible_sel · 3382ade3
      Matthew Pickering authored
      These functions are record selectors.
      
      To the unfamiliar, when inspecting core, they looked like data
      constructors as they started with an upper case letter. We rename them
      so that it is more clear that firstly they are functions and secondly
      that they are selectors.
      
      Reviewers: bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4280
      3382ade3
    • Ryan Scott's avatar
      Fix #14608 by restoring an unboxed tuple check · ecff651f
      Ryan Scott authored
      Commit 714bebff removed
      a check in the bytecode compiler that caught illegal uses of unboxed
      tuples (and now sums) in case alternatives, which causes the program
      in #14608 to panic. This restores the check (using modern,
      levity-polymorphic vocabulary).
      
      Test Plan: make test TEST=T14608
      
      Reviewers: hvr, bgamari, dfeuer, simonpj
      
      Reviewed By: dfeuer, simonpj
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #14608
      
      Differential Revision: https://phabricator.haskell.org/D4276
      ecff651f
    • Tamar Christina's avatar
      Make System.IO.openTempFile thread-safe on Windows · 46287af0
      Tamar Christina authored
      This calls out to the Win32 API `GetTempFileName` to generate
      a temporary file. Using `uUnique = 0` guarantees that the file
      we get back is unique and the file is "reserved" by creating it.
      
      Test Plan:
      ./validate
      
      I can't think of any sensible tests that shouldn't run for a while
      to verify. So the example in #10731 was ran for a while and no
      collisions in new code
      
      Reviewers: hvr, bgamari, erikd
      
      Reviewed By: bgamari
      
      Subscribers: RyanGlScott, rwbarton, thomie, carter
      
      GHC Trac Issues: #10731
      
      Differential Revision: https://phabricator.haskell.org/D4278
      46287af0
    • Tamar Christina's avatar
      Windows: fix all failing tests. · 27b7b4db
      Tamar Christina authored
      This makes the testsuite pass clean on Windows again.
      It also fixes the `libstdc++-6.dll` error harbormaster
      was showing.
      
      I'm marking some tests as isolated tests to reduce their
      flakiness (mostly concurrency tests) when the test system
      is under heavy load.
      
      Updates process submodule.
      
      Test Plan: ./validate
      
      Reviewers: hvr, bgamari, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4277
      27b7b4db
    • Nathan Collins's avatar
      Improve Control.Monad docs · 4887c308
      Nathan Collins authored
      Summary:
      * Reformat Control.Monad.mfilter docs
      
      The formatting was bad, with everything running together, and a
      paranthesis was missing. Now the examples and relation between
      `filter` and `mfilter` are typeset as code blocks instead of inline.
      
      * Add example to Control.Monad.join docs
      
      The example is using `join . atomically` to run IO actions computed by
      STM transactions.
      
      I couldn't figure out how to link to the STM docs in
      `Control.Monad.STM`, because that module comes from the `stm` package,
      not from `base`, even though `stm` is also part of the GHC source
      tree. So, instead I linked to the STM docs in `GHC.Conc`, which seems
      inferior to linking to `Control.Monad.STM`, but better than having no
      links at all.
      
      * Add example to Control.Monad.forever docs
      
      The example is a simple TCP echo server. To make the uses of `forever`
      stand out in the example code, I only link to the non-`forever`
      functions (e.g. `forkFinally`) in the import lists.
      
      Reviewers: bgamari, hvr
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4259
      4887c308
    • Nathan Collins's avatar
      Add example to Control.Monad.join docs · a67c2642
      Nathan Collins authored
      The example is using `join . atomically` to run IO actions computed by
      STM transactions.
      
      I couldn't figure out how to link to the STM docs in
      `Control.Monad.STM`, because that module comes from the `stm` package,
      not from `base`, even though `stm` is also part of the GHC source
      tree. So, instead I linked to the STM docs in `GHC.Conc`, which seems
      inferior to linking to `Control.Monad.STM`, but better than having no
      links at all.
      a67c2642
    • Nathan Collins's avatar
      Reformat Control.Monad.mfilter docs · 69f1e49d
      Nathan Collins authored
      The formatting was bad, with everything running together, and a
      paranthesis was missing. Now the examples and relation between
      `filter` and `mfilter` are typeset as code blocks instead of inline.
      69f1e49d
    • Steven Shaw's avatar
      Prevent "C--" translating to "C–" in the User's Guide. · 12f5c005
      Steven Shaw authored
      i.e. escape "--" so that it doesn't translate to an "en dash".
      12f5c005
    • Galen Huntington's avatar
      Fix sign error in kelvinToC. · b31c7214
      Galen Huntington authored
      b31c7214
    • Ben Gamari's avatar
      users-guide: Fix markup · a2e95495
      Ben Gamari authored
      a2e95495
    • Joachim Breitner's avatar
      Rewrite Note [The polymorphism rule of join points] · 862c59e7
      Joachim Breitner authored
      I found the reference to CPS unhelpful, but Simon gave me a good
      explanation in #14610 that I believe is going to be more enlightening
      for future readers.
      
      Differential Revision: https://phabricator.haskell.org/D4281
      862c59e7
  5. 28 Dec, 2017 1 commit
  6. 26 Dec, 2017 2 commits
    • Richard Eisenberg's avatar
      Fix #14618 by applying a subst in deeplyInstantiate · 722a6584
      Richard Eisenberg authored
      Previously, we were inexplicably not applying an instantiating
      substitution to arguments in non-prenex types. It's amazing this
      has been around for so long! I guess there aren't a lot of non-prenex
      types around.
      
      test case: typecheck/should_fail/T14618
      722a6584
    • niteria's avatar
      Compute InScopeSet in substInteractiveContext · e19b6464
      niteria authored
      It doesn't look like we keep any sets of free variables
      of the types of Ids handy, so we just have to build them
      when doing a substitution.
      
      Test Plan: buildbot + run testsuite with debug
      
      Reviewers: simonmar, simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: carter, rwbarton, thomie
      
      GHC Trac Issues: #11371
      
      Differential Revision: https://phabricator.haskell.org/D3431
      e19b6464
  7. 25 Dec, 2017 1 commit
  8. 23 Dec, 2017 1 commit
  9. 22 Dec, 2017 3 commits
  10. 21 Dec, 2017 4 commits
    • Herbert Valerio Riedel's avatar
      Sync `ghc-prim` changelog from GHC 8.2 · fc257e4b
      Herbert Valerio Riedel authored
      (cherry picked from commit 4d99a665)
      fc257e4b
    • Richard Eisenberg's avatar
      Comments only [skip ci] · 05551d00
      Richard Eisenberg authored
      This fixes a typo and elaborates the Note [TyVarBndrs ...]
      in TyCoRep, which was previously subtly wrong about
      Required ForAllTys.
      05551d00
    • Gabor Greif's avatar
      Typos in comments · bcb519c5
      Gabor Greif authored
      bcb519c5
    • Simon Peyton Jones's avatar
      Fix floating of equalities · f5cf9d1a
      Simon Peyton Jones authored
      This rather subtle patch fixes Trac #14584.  The problem was
      that we'd allowed a coercion, bound in a nested scope, to escape
      into an outer scope.
      
      The main changes are
      
      * TcSimplify.floatEqualities takes more care when floating
        equalities to make sure we don't float one out that mentions
        a locally-bound coercion.
        See Note [What prevents a constraint from floating]
      
      * TcSimplify.emitResidualConstraints (which emits the residual
        constraints in simplifyInfer) now avoids burying the constraints
        for escaping CoVars inside the implication constraint.
      
      * Since I had do to this stuff with CoVars, I moved the
        fancy footwork about not quantifying over CoVars from
        TcMType.quantifyTyVars to its caller
        TcSimplify.decideQuantifiedTyVars.  I think its other
        callers don't need to worry about all this CoVar stuff.
      
      This turned out to be surprisigly tricky, and took me a solid
      day to get right.  I think the result is reasonably neat, though,
      and well documented with Notes.
      f5cf9d1a