1. 11 Dec, 2017 5 commits
    • Kirill Zaborsky's avatar
      Fixed misprint 'aqcuired' · 21be5bde
      Kirill Zaborsky authored
      21be5bde
    • Gabor Greif's avatar
      Only look for locales of the form LL.VV · abd5db60
      Gabor Greif authored
      Because in recent RHEL7 suddenly locales like `bokmål` pop up, which
      screw up reading-in of ASCII strings a line later. This additional
      criterion reliably eliminates those unicode characters.
      abd5db60
    • Simon Peyton Jones's avatar
      Fix SigTvs at the kind level · 8361b2c5
      Simon Peyton Jones authored
      This patch fixes two bugs in the treatment of SigTvs at the
      kind level:
      
      - We should always generalise them, never default them
        (Trac #14555, #14563)
      
      - We should check if they get unified with each other
        (Trac #11203)
      
      Both are described in TcHsType
         Note [Kind generalisation and SigTvs]
      8361b2c5
    • Simon Peyton Jones's avatar
      Build only well-kinded types in type checker · 8b36ed12
      Simon Peyton Jones authored
      During type inference, we maintain the invariant that every type is
      well-kinded /without/ zonking; and in particular that typeKind does
      not fail (as it can for ill-kinded types).
      
      But TcHsType.tcInferApps was not guaranteeing this invariant,
      resulting in Trac #14174 and #14520.
      
      This patch fixes it, making things better -- but it does /not/
      fix the program in Trac #14174 comment:5, which still crashes.
      So more work to be done.
      
      See Note [Ensure well-kinded types] in TcHsType
      8b36ed12
    • Simon Peyton Jones's avatar
      716acbb5
  2. 08 Dec, 2017 5 commits
    • Ben Gamari's avatar
      Add hadrian as a submodule · 4335c07c
      Ben Gamari authored
      It will remain a submodule until we are ready to merge Hadrian into the
      tree.
      4335c07c
    • Ben Gamari's avatar
      Rip out hadrian subtree · 7733e44d
      Ben Gamari authored
      Sadly subtrees haven't worked quite as well as we would have liked for
      developers. See Hadrian #440.
      7733e44d
    • Simon Peyton Jones's avatar
      Occurrrence analysis improvements for NOINLINE functions · 5695f462
      Simon Peyton Jones authored
      This patch fixes #14567.  The idea is simple: if a function
      is marked NOINLINE then it makes a great candidate for a loop
      breaker.
      
      Implementation is easy too, but it needs a little extra plubming,
      notably the occ_unf_act field in OccEnv
      5695f462
    • Simon Peyton Jones's avatar
      Improve LiberateCase · 800009d9
      Simon Peyton Jones authored
      This patch, which fixes Trac #14566, makes LiberateCase a little
      more conservative.  In particular:
      
      * In libCaseBind, treat a recursive group as a whole, rather than
        binding-by-binding, allowing the group to be duplicated only if
          - the bindings /considered together/ are smaller than the
            liberate-case threshold (which is large by default)
          - none of them are thunks
          - none of them are guaranteed-diverging
      
        The latter condidtion is new, and happens to apply in the
        case of Data/Typeable/Internal.mkTrApp
      800009d9
    • Simon Peyton Jones's avatar
      Refactor kcHsTyVarBndrs · de204409
      Simon Peyton Jones authored
      This refactoring
      
      * Renames kcHsTyVarBndrs to kcLHsQTyVars,
        which is more truthful. It is only used in getInitialKind.
      
      * Pulls out bind_telescope from that function, and calls it
        kcLHsTyVarBndrs, again to reflect its argument
      
      * Uses the new kcLHsTyVarBndrs in kcConDecl, where the old
        function was wild overkill.
      
      There should not be any change in behaviour
      de204409
  3. 07 Dec, 2017 3 commits
    • Herbert Valerio Riedel's avatar
      Revert accidental hsc2hs submodule downgrade · e4a1f032
      Herbert Valerio Riedel authored
      This submodule update was committed unintentionally in
      fa29df02
      e4a1f032
    • Simon Peyton Jones's avatar
      Refactor ConDecl: Trac #14529 · fa29df02
      Simon Peyton Jones authored
      This patch refactors HsDecls.ConDecl.  Specifically
      
      * ConDeclGADT was horrible, with all the information hidden
        inside con_res_ty.  Now it's kept separate, as it should be.
      
      * ConDeclH98: use [LHsTyVarBndr] instead of LHsQTyVars for the
        existentials. There is no implicit binding here.
      
      * Add a field con_forall to both ConDeclGADT and ConDeclH98
        which says if there is an explicit user-written forall.
      
      * Field renamings in ConDecl
           con_cxt     to con_mb_cxt
           con_details to con_args
      
      There is an accompanying submodule update to Haddock.
      
      Also the following change turned out to remove a lot of clutter:
      
      * add a smart constructor for HsAppsTy, namely mkHsAppsTy,
        and use it consistently. This avoids a lot of painful pattern
        matching for the common singleton case.
      
      Two api-annotation tests (T10278, and T10399) are broken, hence marking
      them as expect_broken(14529).  Alan is going to fix them, probably by
      changing the con_forall field to
         con_forall :: Maybe SrcSpan
      instead of Bool
      fa29df02
    • Herbert Valerio Riedel's avatar
      Forward-port changes from GHC 8.2 branch · 5f332e1d
      Herbert Valerio Riedel authored
      (cherry picked from commit 3fa061a6)
      5f332e1d
  4. 05 Dec, 2017 2 commits
    • Sergei Trofimovich's avatar
      utils/hsc2hs: update submodule · 1ecbe9cc
      Sergei Trofimovich authored
      
      
      This pulls single change to fix building of cross-compilers:
      * ghc.mk: Use the same conditional install logic from unlit
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4248
      1ecbe9cc
    • Sergei Trofimovich's avatar
      rts: fix filename case for mingw32 target · 30d6373e
      Sergei Trofimovich authored
      
      
      The failure is visible when we build a cross-compiler
      from linux to mingw32 as:
      
      ```
          $ ./configure --host=x86_64-pc-linux-gnu \
                        --target=x86_64-w64-mingw32
          $ make
          rts/linker/PEi386.c:159:10: error:
               fatal error: Psapi.h: No such file or directory
               #include <Psapi.h>
                        ^~~~~~~~~
              |
          159 | #include <Psapi.h>
              |          ^
      ```
      
      The problem here is case-sensitive linux filesystem. On windows
      it does not matter what case is used for includes and libraries.
      
      mingw32 provides all libraries and headers lowercase. This change
      fixes case for <dbghelp.h>, <psapi.h>, -ldbghelp, -lpsapi.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Reviewers: bgamari, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4247
      30d6373e
  5. 04 Dec, 2017 4 commits
    • Ben Gamari's avatar
      Bump version to 8.5 · d6fccfb2
      Ben Gamari authored
      The ghc-8.4 branch has now been cut. Updates the haddock submodule.
      d6fccfb2
    • Ben Gamari's avatar
      Fix ghc_packages · 595f60fd
      Ben Gamari authored
      The LaTeX produced by this previously failed to compile. Changing the first cell
      of the row from an inline to a paragraph fixes this. Then I noticed that the
      table overflowed the page. This is fixed by applying the longtable class.
      595f60fd
    • Ben Gamari's avatar
      template-haskell: Rip out FamFlavour · cfea7450
      Ben Gamari authored
      This was scheduled to happen for 8.2, it looks like it will actually
      happen in 8.4.
      cfea7450
    • David Feuer's avatar
      Make the Con and Con' patterns produce evidence · 1acb922b
      David Feuer authored
      Matching with the `Con` and `Con'` patterns can reveal evidence
      that the type in question is *not* an application. This can help
      the pattern checker.
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: carter, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D4139
      1acb922b
  6. 01 Dec, 2017 4 commits
    • David Feuer's avatar
      Cache TypeRep kinds aggressively · bc761ad9
      David Feuer authored
      Cache `TypeRep k` in each `TrApp` or `TrTyCon` constructor of
      `TypeRep (a :: k)`. This makes `typeRepKind` cheap.
      
      With this change, we won't need any special effort to deserialize
      typereps efficiently. The downside, of course, is that we make
      `TypeRep`s slightly larger.
      
      Reviewers: austin, hvr, bgamari, simonpj
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: carter, simonpj, rwbarton, thomie
      
      GHC Trac Issues: #14254
      
      Differential Revision: https://phabricator.haskell.org/D4085
      bc761ad9
    • David Feuer's avatar
      Add trace injection · 12efb230
      David Feuer authored
      Add support for injecting runtime calls to `trace` in `DsM`. This
      allows the desugarer to add compile-time information to a runtime
      trace.
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: carter, thomie, rwbarton
      
      Differential Revision: https://phabricator.haskell.org/D4162
      12efb230
    • Edward Z. Yang's avatar
      Handle CPP properly in Backpack · e1fb2838
      Edward Z. Yang authored
      
      
      Summary:
      Previously, we attempted to lookup 'hole' packages for
      include directories; this obviously is not going to work.
      Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@fb.com>
      
      Test Plan: validate
      
      Reviewers: ekmett, bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14525
      
      Differential Revision: https://phabricator.haskell.org/D4234
      e1fb2838
    • Edward Z. Yang's avatar
      Make use of boot TyThings during typechecking. · 69987720
      Edward Z. Yang authored
      
      
      Summary:
      Suppose that you are typechecking A.hs, which transitively imports,
      via B.hs, A.hs-boot.  When we poke on B.hs and discover that it
      has a reference to a type from A, what TyThing should we wire
      it up with?  Clearly, if we have already typechecked A, we
      should use the most up-to-date TyThing: the one we freshly
      generated when we typechecked A.  But what if we haven't typechecked
      it yet?
      
      For the longest time, GHC adopted the policy that this was
      *an error condition*; that you MUST NEVER poke on B.hs's reference
      to a thing defined in A.hs until A.hs has gotten around to checking
      this.  However, actually ensuring this is the case has proven
      to be a bug farm.  The problem was especially poignant with
      type family consistency checks, which eagerly happen before
      any typechecking takes place.
      
      This patch takes a different strategy: if we ever try to access
      an entity from A which doesn't exist, we just fall back on the
      definition of A from the hs-boot file.  This means that you may
      end up with a mix of A.hs and A.hs-boot TyThings during the
      course of typechecking.
      Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@fb.com>
      
      Test Plan: validate
      
      Reviewers: simonpj, bgamari, austin, goldfire
      
      Subscribers: thomie, rwbarton
      
      GHC Trac Issues: #14396
      
      Differential Revision: https://phabricator.haskell.org/D4154
      69987720
  7. 29 Nov, 2017 7 commits
  8. 28 Nov, 2017 10 commits