1. 09 Jan, 2018 2 commits
    • Simon Peyton Jones's avatar
      Fix join-point decision · 66ff794f
      Simon Peyton Jones authored
      This patch moves the "ok_unfolding" test
         from  CoreOpt.joinPointBinding_maybe
         to    OccurAnal.decideJoinPointHood
      
      Previously the occurrence analyser was deciding to make
      something a join point, but the simplifier was reversing
      that decision, which made the decision about /other/ bindings
      invalid.
      
      Fixes Trac #14650.
      66ff794f
    • Simon Peyton Jones's avatar
      Remove a bogus warning · 30b1fe2f
      Simon Peyton Jones authored
      The new comment explains why this warning can
      legitimately fire, so I've removed it entirely.
      Lint will cath any bad cases.
      30b1fe2f
  2. 08 Jan, 2018 2 commits
    • Christiaan Baaij's avatar
      Export typeNat{Div;Mod;Log}TyCon from TcTypeNats · fb78b0d2
      Christiaan Baaij authored
      Summary: To be in line with the other typeNatTyCons
      
      Reviewers: bgamari, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: RyanGlScott, rwbarton, thomie, carter
      
      GHC Trac Issues: #14632
      
      Differential Revision: https://phabricator.haskell.org/D4284
      fb78b0d2
    • Simon Marlow's avatar
      Improve accuracy of get/setAllocationCounter · a1a689dd
      Simon Marlow authored
      Summary:
      get/setAllocationCounter didn't take into account allocations in the
      current block. This was known at the time, but it turns out to be
      important to have more accuracy when using these in a fine-grained
      way.
      
      Test Plan:
      New unit test to test incrementally larger allocaitons.  Before I got
      results like this:
      
      ```
      +0
      +0
      +0
      +0
      +0
      +4096
      +0
      +0
      +0
      +0
      +0
      +4064
      +0
      +0
      +4088
      +4056
      +0
      +0
      +0
      +4088
      +4096
      +4056
      +4096
      ```
      
      Notice how the results aren't always monotonically increasing.  After
      this patch:
      
      ```
      +344
      +416
      +488
      +560
      +632
      +704
      +776
      +848
      +920
      +992
      +1064
      +1136
      +1208
      +1280
      +1352
      +1424
      +1496
      +1568
      +1640
      +1712
      +1784
      +1856
      +1928
      +2000
      +2072
      +2144
      ```
      
      Reviewers: niteria, bgamari, hvr, erikd
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4288
      a1a689dd
  3. 07 Jan, 2018 1 commit
    • Ryan Scott's avatar
      Make the Div and Mod type families `infixl 7` · 303106d5
      Ryan Scott authored
      Commit fa8035e3 added `Div`
      and `Mod` type families to `GHC.TypeNats`. However, they did not add
      the corresponding fixities! Currently, we have that both `div` and
      `mod` (at the value level) are `infixl 7`, so we should adopt the
      same fixities for the type-level `Div` and `Mod` as well.
      
      Test Plan: It compiles
      
      Reviewers: hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14640
      
      Differential Revision: https://phabricator.haskell.org/D4291
      303106d5
  4. 05 Jan, 2018 2 commits
  5. 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
  6. 03 Jan, 2018 10 commits
  7. 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
  8. 28 Dec, 2017 1 commit
  9. 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
  10. 25 Dec, 2017 1 commit
  11. 23 Dec, 2017 1 commit
  12. 22 Dec, 2017 1 commit