diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-01-11 17:48:04 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-17 05:55:37 -0500 |
commit | 6f9a817ffff5eec8575ced9b445a63ae56c1e115 (patch) | |
tree | 72c49ce56d3a4a73b10ff17f842bfcf13846783f /testsuite/tests | |
parent | 907f1e4a8bb159c082c30d436f4555110e1055c2 (diff) | |
download | haskell-6f9a817ffff5eec8575ced9b445a63ae56c1e115.tar.gz |
Bignum: fix for Integer/Natural Ord instances
* allow `integerCompare` to inline into `integerLe#`, etc.
* use `naturalSubThrow` to implement Natural's `(-)`
* use `naturalNegate` to implement Natural's `negate`
* implement and use `integerToNaturalThrow` to implement Natural's `fromInteger`
Thanks to @christiaanb for reporting these
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/numeric/should_compile/T14465.stdout | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/testsuite/tests/numeric/should_compile/T14465.stdout b/testsuite/tests/numeric/should_compile/T14465.stdout index d9287fcd32..b493cee119 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: 40, types: 17, coercions: 0, joins: 0/0} + = {terms: 35, types: 14, coercions: 0, joins: 0/0} -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ten :: Natural @@ -52,19 +52,15 @@ M.minusOne1 :: Natural WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 100 0}] M.minusOne1 = 1 --- RHS size: {terms: 11, types: 4, coercions: 0, joins: 0/0} +-- RHS size: {terms: 6, types: 1, coercions: 0, joins: 0/0} minusOne :: Natural [GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False, - WorkFree=True, Expandable=False, Guidance=IF_ARGS [] 40 0}] + WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 40 10}] minusOne - = case M.minusOne1 of wild { - NS ds1 -> - case ds1 of { - __DEFAULT -> GHC.Num.$fNumNatural1; - 0## -> wild - }; - NB ipv -> GHC.Num.$fNumNatural1 + = case GHC.Num.Natural.$wnaturalNegate M.minusOne1 of ww + { __DEFAULT -> + GHC.Num.Natural.NS ww } -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} |