diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-10-06 12:39:35 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-07 20:20:01 -0400 |
commit | 3a5a5c859b59f596043b4c091d944f2a9951d0a2 (patch) | |
tree | 2cb9896162ba2025e3faeefc56fdd4136aafe0bb /testsuite | |
parent | 44886aaba46230de003fb99153a3120667225302 (diff) | |
download | haskell-3a5a5c859b59f596043b4c091d944f2a9951d0a2.tar.gz |
Bignum: allow naturalToWordClamp/Negate/Signum to inline (#20361)
We don't need built-in rules now that bignum literals (e.g. 123 :: Natural)
match with their constructors (e.g. NS 123##).
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/numeric/should_compile/T14465.stdout | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/testsuite/tests/numeric/should_compile/T14465.stdout b/testsuite/tests/numeric/should_compile/T14465.stdout index c672fdf3e0..7ce467bc60 100644 --- a/testsuite/tests/numeric/should_compile/T14465.stdout +++ b/testsuite/tests/numeric/should_compile/T14465.stdout @@ -1,7 +1,7 @@ ==================== Tidy Core ==================== Result size of Tidy Core - = {terms: 37, types: 14, coercions: 0, joins: 0/0} + = {terms: 32, types: 14, coercions: 0, joins: 0/0} -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ten :: Natural @@ -45,23 +45,15 @@ M.$trModule :: GHC.Types.Module WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] M.$trModule = GHC.Types.Module M.$trModule3 M.$trModule1 --- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} -M.minusOne1 :: Natural -[GblId, - Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, - WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] -M.minusOne1 = GHC.Num.Natural.NS 1## - --- RHS size: {terms: 6, types: 1, coercions: 0, joins: 0/0} +-- RHS size: {terms: 1, types: 1, coercions: 0, joins: 0/0} minusOne :: Natural [GblId, + Str=b, + Cpr=b, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False, - WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 10}] -minusOne - = case GHC.Num.Natural.$wnaturalNegate M.minusOne1 of ww - { __DEFAULT -> - GHC.Num.Natural.NS ww - } + WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] +minusOne = GHC.Prim.Exception.raiseUnderflow @Natural -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} twoTimesTwo :: Natural @@ -70,6 +62,13 @@ twoTimesTwo :: Natural WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] twoTimesTwo = GHC.Num.Natural.NS 4## +-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} +M.one1 :: Natural +[GblId, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 10}] +M.one1 = GHC.Num.Natural.NS 1## + -- RHS size: {terms: 4, types: 1, coercions: 0, joins: 0/0} plusOne :: Natural -> Natural [GblId, @@ -77,7 +76,7 @@ plusOne :: Natural -> Natural Str=<1L>, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [0] 30 0}] -plusOne = \ (n :: Natural) -> naturalAdd n M.minusOne1 +plusOne = \ (n :: Natural) -> naturalAdd n M.one1 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} one :: Natural @@ -85,7 +84,7 @@ one :: Natural Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] -one = M.minusOne1 +one = M.one1 |