1. 11 Jan, 2019 1 commit
  2. 08 Jan, 2019 1 commit
    • Ryan Scott's avatar
      Be pickier about unsaturated synonyms in :kind · 6b70cf61
      Ryan Scott authored
      Summary:
      We currently permit any and all uses of unsaturated type
      synonyms and type families in GHCi's `:kind` command, which allows
      strange interactions like this one:
      
      ```
      > :set -XTypeFamilies -XPolyKinds
      > type family Id (a :: k)
      > type instance Id a = a
      > type Foo x = Maybe
      > :kind! Id Foo
      ```
      
      This is probably a stretch too far, so this patch moves to disallow
      unsaturated synonyms that aren't at the top level (we still want to
      allow `:kind Id`, for instance). We do this by augmenting `GhciCtxt`
      with an additional `Bool` field to indicate if we are at the
      outermost level of the type being passed to `:kind` or not. See
      `Note [Unsaturated type synonyms in GHCi]` in `TcValidity` for the
      full story.
      
      Test Plan: make test TEST=T16013
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: goldfire
      
      Subscribers: simonpj, goldfire, rwbarton, carter
      
      GHC Trac Issues: #16013
      
      Differential Revision: https://phabricator.haskell.org/D5471
      6b70cf61
  3. 06 Jan, 2019 2 commits
  4. 03 Jan, 2019 1 commit
    • My Nguyen's avatar
      Visible kind application · 17bd1635
      My Nguyen authored
      Summary:
      This patch implements visible kind application (GHC Proposal 15/#12045), as well as #15360 and #15362.
      It also refactors unnamed wildcard handling, and requires that type equations in type families in Template Haskell be
      written with full type on lhs. PartialTypeSignatures are on and warnings are off automatically with visible kind
      application, just like in term-level.
      
      There are a few remaining issues with this patch, as documented in
      ticket #16082.
      
      Includes a submodule update for Haddock.
      
      Test Plan: Tests T12045a/b/c/TH1/TH2, T15362, T15592a
      
      Reviewers: simonpj, goldfire, bgamari, alanz, RyanGlScott, Iceland_jack
      
      Subscribers: ningning, Iceland_jack, RyanGlScott, int-index, rwbarton, mpickering, carter
      
      GHC Trac Issues: `#12045`, `#15362`, `#15592`, `#15788`, `#15793`, `#15795`, `#15797`, `#15799`, `#15801`, `#15807`, `#15816`
      
      Differential Revision: https://phabricator.haskell.org/D5229
      17bd1635
  5. 01 Jan, 2019 1 commit
    • Peter Trommler's avatar
      PPC NCG: Remove Darwin support · 374e4470
      Peter Trommler authored
      Support for Mac OS X on PowerPC has been dropped by Apple years ago. We
      follow suit and remove PowerPC support for Darwin.
      
      Fixes #16106.
      374e4470
  6. 29 Dec, 2018 2 commits
  7. 28 Dec, 2018 1 commit
  8. 27 Dec, 2018 1 commit
  9. 25 Dec, 2018 3 commits
    • Ben Gamari's avatar
      testsuite: Skip ffi018_ghci when unregisterised · 7bfc1e81
      Ben Gamari authored
      As noted in #16085 this test is fragile in unregisterised compilers.
      7bfc1e81
    • Ben Gamari's avatar
      testsuite: Fix a variety of issues when building with integer-simple · 99378207
      Ben Gamari authored
       * Mark arith011 as broken with integer-simple
      
         As noted in #16091, arith011 fails when run against integer-simple with a
         "divide by zero" exception. This suggests that integer-gmp and integer-simple
         are handling division by zero differently.
      
       * This also fixes broken_without_gmp; the lack of types made the previous
         failure silent, sadly. Improves situation of #16043.
      
       * Mark several tests implicitly depending upon integer-gmp as broken
         with integer-simple. These expect to see Core coming from integer-gmp,
         which breaks with integer-simple.
      
       * Increase runtime timeout multiplier of T11627a with integer-simple
      
         I previously saw that T11627a timed out in all profiling ways when run against
         integer-simple. I suspect this is due to integer-simple's rather verbose heap
         representation. Let's see whether increasing the runtime timeout helps.
      
         Fixes test for #11627.
      
      This is all in service of fixing #16043.
      99378207
    • Ben Gamari's avatar
      testsuite: Enable T11627a on Darwin · 6d9d6f9a
      Ben Gamari authored
      The retainer profiler no longer uses the C stack for its mark stack (#14758).
      Consequently even the small C stack provided on Darwin should be sufficient to
      run this test. See #11627
      6d9d6f9a
  10. 24 Dec, 2018 2 commits
    • Ömer Sinan Ağacan's avatar
      Simplify Core output with -dsuppress-type-signatures · 8a0fca09
      Ömer Sinan Ağacan authored
      Currently we duplicate top-level binder ids for no reason:
      
          $fEqHsExpr_$c/=
          $fEqHsExpr_$c/=
            = \ @ id_a27U $dEq_a27V eta_B2 eta1_B1 ->
                case $fEqHsExpr_$c== $dEq_a27V eta_B2 eta1_B1 of {
                  False -> True;
                  True -> False
                }
      
      with this patch we drop the first line when type signatures are not
      printed (-dsuppress-type-signatures, which is implied by -dsuppress-all)
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5472
      8a0fca09
    • Ben Gamari's avatar
      testsuite: Mark th tests as broken in ext-interp way in LLVM build flavours · 5499f12f
      Ben Gamari authored
      This is due to the failures documented in #16087. The condition here could be
      improved as it matches on `BUILD_FLAVOUR` instead of looking at the compiler
      flags. However, it's better than nothing and I hope we will be able to fix these
      issues before long.
      5499f12f
  11. 22 Dec, 2018 4 commits
  12. 21 Dec, 2018 3 commits
    • Simon Peyton Jones's avatar
      Fix treatment of hi-boot files and dfuns · a57d5c4d
      Simon Peyton Jones authored
      Trac #16038 exposed the fact that TcRnDriver.checkHiBootIface
      was creating a binding, in the module being compiled, for
         $fxBlah = $fBlah
      
       but $fxBlah was a /GlobalId/. But all bindings should be for
       /LocalIds/ else dependency analysis goes down the tubes.
      
      * I added a CoreLint check that an occurrence of a GlobalId
        is not bound by an binding of a LocalId.  (There is already
        a binding-site check that no binding binds a GlobalId.)
      
      * I refactored (and actually signficantly simplified) the
        tricky code for dfuns in checkHiBootIface to ensure that
        we get LocalIds for those boot-dfuns.
      
      Alas, I then got "duplicate instance" messages when compiling
      HsExpr. It turns out that this is a long-standing, but extremely
      delicate, bug: even before this patch, if you compile HsExpr
      with -ddump-tc-trace, you get "duplicate instance". Without
      -ddump-tc-trace, it's OK.  What a mess!
      
      The reason for the duplicate-instance is now explained in
      Note [Loading your own hi-boot file] in LoadIface.  I fixed
      it by a Gross Hack in LoadIface.loadInterface. This is at
      least no worse than before.
      
      But there should be a better way. I have opened #16081 for this.
      a57d5c4d
    • Simon Peyton Jones's avatar
      Make candidateQTvs contain tyvar with zonked kinds · 71e26a74
      Simon Peyton Jones authored
      candidateQTyVars was failing to return fully-zonked
      tyvars, and that made things fall over chaotically
      when we try to sort them into a well-scoped telescope.
      Result: Trac #15795
      
      So I made candidateQTvs guarantee to have fully-zonked
      tyvars (i.e. with zonked kinds).  That's a bit annoying
      but not really difficult.
      71e26a74
    • Ryan Scott's avatar
      Fix #16002 by moving a validity check to the renamer · 28f41f1a
      Ryan Scott authored
      Summary:
      The validity check which rejected things like:
      
      ```lang=haskell
      type family B x where
        A x = x
      ```
      
      Used to live in the typechecker. But it turns out that this validity
      check was //only// being run on closed type families without CUSKs!
      This meant that GHC would silently accept something like this:
      
      ```lang=haskell
      type family B (x :: *) :: * where
        A x = x
      ```
      
      This patch fixes the issue by moving this validity check to the
      renamer, where we can be sure that the check will //always// be run.
      
      Test Plan: make test TEST=T16002
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: goldfire, rwbarton, carter
      
      GHC Trac Issues: #16002
      
      Differential Revision: https://phabricator.haskell.org/D5420
      28f41f1a
  13. 20 Dec, 2018 2 commits
  14. 19 Dec, 2018 3 commits
    • Ryan Scott's avatar
      Fix #16030 by refactoring IfaceSyn's treatment of GADT constructors · 9d9e3557
      Ryan Scott authored
      Summary:
      GHCi's `:info` command was pretty-printined GADT
      constructors suboptimally in the following ways:
      
      1. Sometimes, fields were parenthesized when they did not need it,
         e.g.,
      
      ```lang=haskell
      data Foo a where
        MkFoo :: (Maybe a) -> Foo a
      ```
      
         I fixed this by refactoring some code in `pprIfaceConDecl` to be a
         little smarter with respect to GADT syntax. See `pprFieldArgTy`
         and `pprArgTy`.
      2. With `-fprint-explicit-kinds` enabled, there would be times when
         specified arguments would be printed without a leading `@` in GADT
         return types, e.g.,
      
      ```lang=haskell
      data Bar @k (a :: k) where
        MkBar :: Bar k a
      ```
      
         It turns out that `ppr_tc_app`, the function which pretty-prints
         these return types, was not using the proper machinery to print
         out the arguments, which caused the visibilities to be forgotten
         entirely. I refactored `ppr_tc_app` to do this correctly.
      
      Test Plan: make test TEST=T16030
      
      Reviewers: goldfire, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, carter
      
      GHC Trac Issues: #16030
      
      Differential Revision: https://phabricator.haskell.org/D5440
      9d9e3557
    • Krzysztof Gogolewski's avatar
      Use unicode arrows with -fprint-unicode-syntax · d555d4be
      Krzysztof Gogolewski authored
      Summary:
      See #8959, this is one more place where we
      can pretty-print Unicode syntax.
      
      Test Plan: validate
      
      Reviewers: nomeata, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #8959
      
      Differential Revision: https://phabricator.haskell.org/D5439
      d555d4be
    • chessai's avatar
      don't suggest Rank2Types in error messages (Fixed #16000) · de50f8fd
      chessai authored
      Summary: Rank2Types is deprecated. Don't suggest to users to use it.
      
      Reviewers: bgamari, RyanGlScott, simonpj
      
      Reviewed By: RyanGlScott, simonpj
      
      Subscribers: RyanGlScott, rwbarton, carter
      
      GHC Trac Issues: #16000
      
      Differential Revision: https://phabricator.haskell.org/D5447
      de50f8fd
  15. 18 Dec, 2018 1 commit
  16. 17 Dec, 2018 1 commit
  17. 13 Dec, 2018 5 commits
  18. 12 Dec, 2018 1 commit
    • Simon Peyton Jones's avatar
      Improvements to demand analysis · d77501cd
      Simon Peyton Jones authored
      This patch collects a few improvements triggered by Trac #15696,
      and fixing Trac #16029
      
      * Stop making toCleanDmd behave specially for unlifted types.
        This special case was the cause of stupid behaviour in Trac
        #16029.  And to my joy I discovered the let/app invariant
        rendered it unnecessary.  (Maybe the special case pre-dated
        the let/app invariant.)
      
        Result: less special-case handling in the compiler, and
        better perf for the compiled code.
      
      * In WwLib.mkWWstr_one, treat seqDmd like U(AAA).  It was not
        being so treated before, which again led to stupid code.
      
      * Update and improve Notes
      
      There are .stderr test wibbles because we get slightly different
      strictness signatures for an argumment of unlifted type:
          <L,U> rather than <S,U>        for Int#
          <S,U> rather than <S(S),U(U)>  for Int
      d77501cd
  19. 11 Dec, 2018 5 commits