1. 21 Sep, 2015 17 commits
    • Edward Z. Yang's avatar
      Unify hsig and hs-boot; add preliminary "hs-boot" merging. · 06d46b1e
      Edward Z. Yang authored
      This patch drops the file level distinction between hs-boot and hsig;
      we figure out which one we are compiling based on whether or not there
      is a corresponding hs file lying around.
      
      To make the "import A" syntax continue to work for bare hs-boot
      files, we also introduce hs-boot merging, which takes an A.hi-boot
      and converts it to an A.hi when there is no A.hs file in scope.
      This will be generalized in Backpack to merge multiple A.hi files together;
      which means we can jettison the "load multiple interface files" functionality.
      
      This works automatically for --make, but for one-shot compilation
      we need a new mode: ghc --merge-requirements A will generate an A.hi/A.o
      from a local A.hi-boot file; Backpack will extend this mechanism further.
      
      Has Haddock submodule update to deal with change in msHsFilePath behavior.
      
          - This commit drops support for the hsig extension. Can
            we support it?  It's annoying because the finder code is
            written with the assumption that where there's an hs-boot
            file, there's always an hs file too.  To support hsig, you'd
            have to probe two locations.  Easier to just not support it.
      
          - #10333 affects us, modifying an hs-boot still doesn't trigger
            recomp.
      
          - See compiler/main/Finder.hs: this diff is very skeevy, but
            it seems to work.
      
          - This code cunningly doesn't drop hs-boot files from the
            "drop hs-boot files" module graph, if they don't have a
            corresponding hs file.  I have no idea if this actually is useful.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari, spinda
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1098
      06d46b1e
    • Edward Z. Yang's avatar
      09d214dc
    • Edward Z. Yang's avatar
      3f13c20e
    • eir@cis.upenn.edu's avatar
      `_ <- mapM` --> `mapM_` · c234acbe
      eir@cis.upenn.edu authored
      Thanks for the suggestion, Austin. Just missed that while making
      a bunch of similar changes.
      c234acbe
    • eir@cis.upenn.edu's avatar
      Refactor BranchLists. · cd2840a7
      eir@cis.upenn.edu authored
      Now we use Array to store branches. This makes sense because we often
      have to do random access (once inference is done). This also vastly
      simplifies the awkward BranchList type.
      
      This fixes #10837 and updates submodule utils/haddock.
      cd2840a7
    • eir@cis.upenn.edu's avatar
      Run simplifier only when the env is clean. · 8e8b9ed9
      eir@cis.upenn.edu authored
      This fixes #10896. In the indexed-types/should_fail/BadSock test,
      there is a bad type definition. This gets type-checked, an error
      gets reported, but then **GHC keeps going**. Later, when
      running the simplifier to do an ambiguity check, the bad type
      environment causes GHC to fall over. My solution: only run the
      simplifier in a clean, error-free type environment.
      
      A downside of this is that fewer error messages are reported.
      This makes me a bit sad, but I'm not sure how to avoid the problem.
      Suggestions welcome.
      8e8b9ed9
    • eir@cis.upenn.edu's avatar
      Perform a validity check on assoc type defaults. · e27b267f
      eir@cis.upenn.edu authored
      This fixes #10817 and #10899. A knock-on effect is that we must
      now remember locations of associated type defaults for error
      messages during validity checking. This isn't too bad, but it
      increases the size of the diff somewhat.
      
      Test cases: indexed-types/should_fail/T108{17,99}
      e27b267f
    • eir@cis.upenn.edu's avatar
      Slightly better `Coercible` errors. · 2f9809ef
      eir@cis.upenn.edu authored
      This makes two real changes:
       - Equalities like (a ~R [a]) really *are* insoluble. Previously,
         GHC refused to give up when an occurs check bit on a representational
         equality. But for datatypes, it really should bail.
      
       - Now, GHC will sometimes report an occurs check error (in cases above)
         for representational equalities. Previously, it never did.
      
      This "fixes" #10715, where by "fix", I mean clarifies the error message.
      It's unclear how to do more to fix that ticket.
      
      Test cases: typecheck/should_fail/T10715{,b}
      2f9809ef
    • eir@cis.upenn.edu's avatar
      Fix typo in test for #10347. · cbcad859
      eir@cis.upenn.edu authored
      Thanks to Gabor Greif for spotting the mistake.
      cbcad859
    • eir@cis.upenn.edu's avatar
      Small improvement in pretty-printing constructors. · 6a209205
      eir@cis.upenn.edu authored
      This fixes #10810 by cleaning up pretty-printing of constructor
      declarations. This change also removes a (in my opinion) deeply
      bogus orphan instance OutputableBndr [Located name], making
      HsDecls now a non-orphan module. Yay all around.
      
      Test case: th/T10810
      6a209205
    • eir@cis.upenn.edu's avatar
      Re-polish error messages around injective TFs. · 93fafe05
      eir@cis.upenn.edu authored
      The previous message was wrong, as pointed out by Jan Stolarek.
      93fafe05
    • eir@cis.upenn.edu's avatar
      Clarify parsing infelicity. · 27f9186d
      eir@cis.upenn.edu authored
      This fixes #10855.
      27f9186d
    • eir@cis.upenn.edu's avatar
      Allow TH quoting of assoc type defaults. · 1292c17e
      eir@cis.upenn.edu authored
      This fixes #10811.
      1292c17e
    • eir@cis.upenn.edu's avatar
      Print associated types a bit better. · 79b8e891
      eir@cis.upenn.edu authored
      This is part of #10811. It removes the "family" keyword from
      associated type family declarations, and it adds the "type"
      keyword to associated type family defaults.
      79b8e891
    • eir@cis.upenn.edu's avatar
      Test #10770 · d7f2ab05
      eir@cis.upenn.edu authored
      d7f2ab05
    • eir@cis.upenn.edu's avatar
      Update user guide, fixing #10772 · d19a77ab
      eir@cis.upenn.edu authored
      d19a77ab
    • eir@cis.upenn.edu's avatar
      Test #10347 · 1a135511
      eir@cis.upenn.edu authored
      1a135511
  2. 20 Sep, 2015 4 commits
  3. 19 Sep, 2015 2 commits
    • eir@cis.upenn.edu's avatar
      Polish some error messages. · 8ee2b953
      eir@cis.upenn.edu authored
      8ee2b953
    • eir@cis.upenn.edu's avatar
      Fix #10815 by kind-checking type patterns against known kinds. · 2d4db40a
      eir@cis.upenn.edu authored
      tcFamTyPats now must take information about the instantiation of any
      class variables, when checking the instance of an associated type.
      
      Getting this to work out required some unexpected refactoring in
      TcDeriv. TcDeriv needs to look at class instances because of the
      possibility of associated datatypes with `deriving` specs. TcDeriv
      worked over the user-specified instances. But any data family instances
      were already processed, and TcDeriv had no way of finding the rep
      tycons. Indeed, TcDeriv *re-type-checked* any data family instances
      in an attempt to rediscover what GHC already knew. So, this commit
      introduces better tracking of compiled data families between TcInstDcls
      and TcDeriv to streamline all of this.
      2d4db40a
  4. 18 Sep, 2015 1 commit
  5. 17 Sep, 2015 5 commits
    • thomie's avatar
      Docs: make sure all libs are included in index.html (#10879) · 48746fff
      thomie authored
      During the build, when HADDOCK_DOCS=YES, the command 'cd libraries && sh
      gen_contents_index --intree' is run, which calls haddock to generate the
      haddock index at 'libraries/dist-haddock/index.html'.
      
      What it did before was check the ./packages file for all libraries. The
      problem is that 'base' and 'ghc-prim' were folded into the main repo
      some time ago, hence don't have an entry in the ./packages file anymore.
      As a result, 'base' and 'ghc-prim' were missing from the index.html
      file.
      
      It now simply runs haddock on all the all the `.haddock` files in the
      libraries directory.
      
      The only risk is that this could include the extra libraries in the
      index.html, if you ever built them in the past (with
      BUILD_EXTRA_PKGS=YES), even though now you want to exclude them (with
      BUILD_EXTRA_PKGS=NO). gen_contents_index doesn't have access to build
      system variables though (PACKAGES_STAGE1+PACKAGES_STAGE2), so fixing
      this would be a little bit fiddly.
      
      Test Plan:
      'make libraries/dist-haddock/index.html && grep -q base
      libraries/dist-haddock/index.html && echo ok'
      
      Reviewed by: austin
      
      Differential Revision: https://phabricator.haskell.org/D1247
      48746fff
    • Ryan Scott's avatar
      Add namePackage function to template-haskell · 77662e13
      Ryan Scott authored
      Currently there exists a nameBase function (for retrieving a Name's OccName)
      and a nameModule function (for retrieving a Name's ModName), but there is no
      counterpart for PkgNames.
      
      This would be useful for implementing Template Haskell features which need
      to have easy access to a Name's package (e.g., automatically derived Lift
      instances).
      
      Reviewed By: goldfire, austin, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1237
      77662e13
    • Simon Marlow's avatar
      ApplicativeDo transformation · 8ecf6d8f
      Simon Marlow authored
      Summary:
      This is an implementation of the ApplicativeDo proposal.  See the Note
      [ApplicativeDo] in RnExpr for details on the current implementation,
      and the wiki page https://ghc.haskell.org/trac/ghc/wiki/ApplicativeDo
      for design notes.
      
      Test Plan: validate
      
      Reviewers: simonpj, goldfire, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D729
      8ecf6d8f
    • Moritz Kiefer's avatar
      Show minimal complete definitions in ghci (#10847) · 43eb1dc5
      Moritz Kiefer authored
      Show the minimal complete definition on :info in ghci. They
      are shown like MINIMAL pragmas in code. If the minimal complete
      definition is empty or only a specific method from a class is
      requested, nothing is shown.
      
      Reviewed By: simonpj, austin, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1241
      43eb1dc5
    • thomie's avatar
      Testsuite: add test for #10781 · 8d89d80d
      thomie authored
      8d89d80d
  6. 16 Sep, 2015 1 commit
  7. 15 Sep, 2015 2 commits
    • thomie's avatar
      Fix `hp2ps -i-` · 325efac2
      thomie authored
      From the help text:
        -i[+|-] sort by identifier string (-i+ gives greatest on top)
      
      Found by David Binderman.
      325efac2
    • Sebastian Reuße's avatar
      Pretty: fix unicode arrow operators. · 14c4090e
      Sebastian Reuße authored
      As per issue #10509, the documentation gave the wrong glyphs for Unicode
      alternatives to the -< and >- arrow operators (the codepoints were
      correct, but the glyphs were not). The incorrect glyphs have also
      made it into the error output. This replaces those characters with the
      correct versions.
      
      GHC Trac Issues: #10883
      14c4090e
  8. 14 Sep, 2015 1 commit
  9. 12 Sep, 2015 5 commits
  10. 11 Sep, 2015 2 commits