[commit: ghc] wip/ghc-8.0-det: Add -foptimal-applicative-do (77a9f01)

git at git.haskell.org git at git.haskell.org
Mon Jul 25 14:59:12 UTC 2016


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

On branch  : wip/ghc-8.0-det
Link       : http://ghc.haskell.org/trac/ghc/changeset/77a9f0130836363f8fe28b179285da949340633d/ghc

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

commit 77a9f0130836363f8fe28b179285da949340633d
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Fri Mar 4 13:06:42 2016 +0000

    Add -foptimal-applicative-do
    
    Summary:
    The algorithm for ApplicativeDo rearrangement is based on a heuristic
    that runs in O(n^2).  This patch adds the optimal algorithm, which is
    O(n^3), selected by a flag (-foptimal-applicative-do).  It finds better
    solutions in a small number of cases (about 2% of the cases where
    ApplicativeDo makes a difference), but it can be very slow for large do
    expressions.  I'm mainly adding it for experimental reasons.
    
    ToDo: user guide docs
    
    Test Plan: validate
    
    Reviewers: simonpj, bgamari, austin, niteria, erikd
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1969
    
    (cherry picked from commit 2f45cf3f48162a5f843005755dafa1c5c1b451a7)


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

77a9f0130836363f8fe28b179285da949340633d
 compiler/main/DynFlags.hs                      |   2 +
 compiler/rename/RnExpr.hs                      | 226 ++++++++++++++++---------
 docs/users_guide/glasgow_exts.rst              |  17 ++
 testsuite/tests/ado/ado-optimal.hs             |  59 +++++++
 testsuite/tests/ado/ado-optimal.stdout         |   1 +
 testsuite/tests/ado/ado004.hs                  |   9 +
 testsuite/tests/ado/ado004.stderr              |   6 +
 testsuite/tests/ado/all.T                      |   1 +
 utils/mkUserGuidePart/Options/Optimizations.hs |   6 +
 9 files changed, 251 insertions(+), 76 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 77a9f0130836363f8fe28b179285da949340633d


More information about the ghc-commits mailing list