diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2016-03-11 15:24:49 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-03-12 12:03:19 +0100 |
commit | 4d791b4f77975422df38f6b43084008edd097f1b (patch) | |
tree | 327edc081c24a62309a88aa2db4f6c407eb12700 /testsuite/tests/roles/should_compile/Roles13.stderr | |
parent | e46742f5c51938bc7c992ac37fecc6df8cab7647 (diff) | |
download | haskell-4d791b4f77975422df38f6b43084008edd097f1b.tar.gz |
Simplify: Make generated names more useful
makeTrivial is responsible for concocting names during simplification.
Previously, however, it would make no attempt to generate a name that
might be useful to later readers of the resulting Core. Here we add a
bit of state to SimplEnv: a finite depth stack of binders within which
we are currently simplifying. We then derive generated binders from this
context.
See #11676.
Open questions:
* Is there a better way to accomplish this?
* Is `maxContextDepth` too large/small?
Test Plan: Validate, look at Core.
Reviewers: austin, simonpj
Reviewed By: simonpj
Subscribers: thomie, simonpj
Differential Revision: https://phabricator.haskell.org/D1970
GHC Trac Issues: #11676
Diffstat (limited to 'testsuite/tests/roles/should_compile/Roles13.stderr')
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles13.stderr | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/testsuite/tests/roles/should_compile/Roles13.stderr b/testsuite/tests/roles/should_compile/Roles13.stderr index 3bd9d88d41..e9b8f1afec 100644 --- a/testsuite/tests/roles/should_compile/Roles13.stderr +++ b/testsuite/tests/roles/should_compile/Roles13.stderr @@ -3,80 +3,92 @@ Result size of Tidy Core = {terms: 51, types: 20, coercions: 5} -- RHS size: {terms: 2, types: 2, coercions: 0} -a :: Wrap Age -> Wrap Age +convert1 :: Wrap Age -> Wrap Age [GblId, Arity=1, Caf=NoCafRefs, Str=DmdType] -a = \ (ds :: Wrap Age) -> ds +convert1 = \ (ds :: Wrap Age) -> ds -- RHS size: {terms: 1, types: 0, coercions: 5} convert :: Wrap Age -> Int [GblId, Arity=1, Caf=NoCafRefs, Str=DmdType] convert = - a + convert1 `cast` (<Wrap Age>_R -> Roles13.N:Wrap[0] Roles13.N:Age[0] :: (Wrap Age -> Wrap Age) ~R# (Wrap Age -> Int)) -- RHS size: {terms: 2, types: 0, coercions: 0} -a1 :: GHC.Types.TrName +$trModule1 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a1 = GHC.Types.TrNameS "main"# +$trModule1 = GHC.Types.TrNameS "main"# -- RHS size: {terms: 2, types: 0, coercions: 0} -a2 :: GHC.Types.TrName +$trModule2 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a2 = GHC.Types.TrNameS "Roles13"# +$trModule2 = GHC.Types.TrNameS "Roles13"# -- RHS size: {terms: 3, types: 0, coercions: 0} Roles13.$trModule :: GHC.Types.Module [GblId, Caf=NoCafRefs, Str=DmdType] -Roles13.$trModule = GHC.Types.Module a1 a2 +Roles13.$trModule = GHC.Types.Module $trModule1 $trModule2 -- RHS size: {terms: 2, types: 0, coercions: 0} -a3 :: GHC.Types.TrName +$tc'MkAge1 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a3 = GHC.Types.TrNameS "'MkAge"# +$tc'MkAge1 = GHC.Types.TrNameS "'MkAge"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tc'MkAge :: GHC.Types.TyCon [GblId, Caf=NoCafRefs, Str=DmdType] Roles13.$tc'MkAge = GHC.Types.TyCon - 1226019810264079099## 12180888342844277416## Roles13.$trModule a3 + 1226019810264079099## + 12180888342844277416## + Roles13.$trModule + $tc'MkAge1 -- RHS size: {terms: 2, types: 0, coercions: 0} -a4 :: GHC.Types.TrName +$tcAge1 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a4 = GHC.Types.TrNameS "Age"# +$tcAge1 = GHC.Types.TrNameS "Age"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tcAge :: GHC.Types.TyCon [GblId, Caf=NoCafRefs, Str=DmdType] Roles13.$tcAge = GHC.Types.TyCon - 18304088376370610314## 1954648846714895105## Roles13.$trModule a4 + 18304088376370610314## + 1954648846714895105## + Roles13.$trModule + $tcAge1 -- RHS size: {terms: 2, types: 0, coercions: 0} -a5 :: GHC.Types.TrName +$tc'MkWrap1 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a5 = GHC.Types.TrNameS "'MkWrap"# +$tc'MkWrap1 = GHC.Types.TrNameS "'MkWrap"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tc'MkWrap :: GHC.Types.TyCon [GblId, Caf=NoCafRefs, Str=DmdType] Roles13.$tc'MkWrap = GHC.Types.TyCon - 12402878715225676312## 13345418993613492500## Roles13.$trModule a5 + 12402878715225676312## + 13345418993613492500## + Roles13.$trModule + $tc'MkWrap1 -- RHS size: {terms: 2, types: 0, coercions: 0} -a6 :: GHC.Types.TrName +$tcWrap1 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a6 = GHC.Types.TrNameS "Wrap"# +$tcWrap1 = GHC.Types.TrNameS "Wrap"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tcWrap :: GHC.Types.TyCon [GblId, Caf=NoCafRefs, Str=DmdType] Roles13.$tcWrap = GHC.Types.TyCon - 5278920226786541118## 14554440859491798587## Roles13.$trModule a6 + 5278920226786541118## + 14554440859491798587## + Roles13.$trModule + $tcWrap1 |