1. 23 Dec, 2018 2 commits
  2. 22 Dec, 2018 4 commits
  3. 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
  4. 20 Dec, 2018 2 commits
  5. 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
  6. 18 Dec, 2018 1 commit
  7. 17 Dec, 2018 1 commit
  8. 14 Dec, 2018 1 commit
  9. 13 Dec, 2018 6 commits
  10. 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
  11. 11 Dec, 2018 16 commits