[commit: ghc] master: Sort valid substitutions for typed holes by "relevance" (cbdea95)

git at git.haskell.org git at git.haskell.org
Fri Jan 26 19:41:20 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/cbdea95938bf09e8e3e7be31918549224d171873/ghc

>---------------------------------------------------------------

commit cbdea95938bf09e8e3e7be31918549224d171873
Author: Matthías Páll Gissurarson <mpg at mpg.is>
Date:   Fri Jan 26 13:07:36 2018 -0500

    Sort valid substitutions for typed holes by "relevance"
    
    This is an initial attempt at tackling the issue of how to order the
    suggestions provided by the valid substitutions checker, by sorting
    them by creating a graph of how they subsume each other. We'd like to
    order them in such a manner that the most "relevant" suggestions are
    displayed first, so that the suggestion that the user might be looking
    for is displayed before more far-fetched suggestions (and thus also
    displayed when they'd otherwise be cut-off by the
    `-fmax-valid-substitutions` limit). The previous ordering was based on
    the order in which the elements appear in the list of imports, which I
    believe is less correlated with relevance than this ordering.
    
    A drawback of this approach is that, since we now want to sort the
    elements, we can no longer "bail out early" when we've hit the
    `-fmax-valid-substitutions` limit.
    
    Reviewers: bgamari, dfeuer
    
    Reviewed By: dfeuer
    
    Subscribers: dfeuer, rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4326


>---------------------------------------------------------------

cbdea95938bf09e8e3e7be31918549224d171873
 compiler/main/DynFlags.hs                          |   8 +-
 compiler/typecheck/TcErrors.hs                     | 166 +++++--
 compiler/typecheck/TcSimplify.hs                   |   7 +-
 compiler/typecheck/TcSimplify.hs-boot              |   4 +-
 docs/users_guide/glasgow_exts.rst                  | 299 +++++++++++--
 docs/users_guide/using-optimisation.rst            |  16 +-
 testsuite/tests/ghci/scripts/T10249.stderr         |   3 +-
 testsuite/tests/ghci/scripts/T8353.stderr          |  60 +--
 testsuite/tests/th/T10267.stderr                   |   8 +-
 .../tests/typecheck/should_compile/T13050.stderr   | 174 ++++----
 .../tests/typecheck/should_compile/T14273.stderr   |  18 +-
 .../tests/typecheck/should_compile/T14590.stderr   | 232 +++++-----
 .../tests/typecheck/should_compile/T9497a.stderr   |   6 +-
 .../should_compile/hole_constraints.stderr         |   4 +-
 .../tests/typecheck/should_compile/holes.stderr    | 496 ++++++++++-----------
 .../tests/typecheck/should_compile/holes2.stderr   |  18 +-
 .../tests/typecheck/should_compile/holes3.stderr   | 496 ++++++++++-----------
 .../should_compile/valid_substitutions.stderr      |  82 ++--
 .../valid_substitutions_interactions.stderr        |   4 +-
 .../tests/typecheck/should_fail/T9497d.stderr      |   6 +-
 .../tests/typecheck/should_run/T9497a-run.stderr   |   6 +-
 .../tests/typecheck/should_run/T9497b-run.stderr   |   6 +-
 .../tests/typecheck/should_run/T9497c-run.stderr   |   6 +-
 23 files changed, 1200 insertions(+), 925 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cbdea95938bf09e8e3e7be31918549224d171873


More information about the ghc-commits mailing list