diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux b/stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux index af43a0e53..f81fa19fd 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux +++ b/stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux @@ -10,7 +10,7 @@ ["." bit ("#@." equivalence)] ["." maybe] [number - ["." nat]] + ["n" nat]] ["." text ["%" format (#+ Format format)]] [collection @@ -29,7 +29,7 @@ (def: known-cases? (-> Nat Bit) - (n/> 0)) + (n.> 0)) ## The coverage of a pattern-matching expression summarizes how well ## all the possible values of an input are being covered by the @@ -147,7 +147,7 @@ (wrap (#Variant (if right? (#.Some idx) #.None) - (|> (dictionary.new nat.hash) + (|> (dictionary.new n.hash) (dictionary.put idx value-coverage))))))) (def: (xor left right) @@ -184,7 +184,7 @@ (bit@= sideR sideS) [(#Variant allR casesR) (#Variant allS casesS)] - (and (n/= (cases allR) + (and (n.= (cases allR) (cases allS)) (:: (dictionary.equivalence =) = casesR casesS)) @@ -195,7 +195,7 @@ [(#Alt _) (#Alt _)] (let [flatR (flatten-alt reference) flatS (flatten-alt sample)] - (and (n/= (list.size flatR) (list.size flatS)) + (and (n.= (list.size flatR) (list.size flatS)) (list.every? (function (_ [coverageR coverageS]) (= coverageR coverageS)) (list.zip2 flatR flatS)))) @@ -229,7 +229,7 @@ so-far-cases (cases allA)] (cond (and (known-cases? addition-cases) (known-cases? so-far-cases) - (not (n/= addition-cases so-far-cases))) + (not (n.= addition-cases so-far-cases))) (ex.throw variants-do-not-match [addition-cases so-far-cases]) (:: (dictionary.equivalence ..equivalence) = casesSF casesA) @@ -250,7 +250,7 @@ casesSF (dictionary.entries casesA))] (wrap (if (and (or (known-cases? addition-cases) (known-cases? so-far-cases)) - (n/= (inc (n/max addition-cases so-far-cases)) + (n.= (inc (n.max addition-cases so-far-cases)) (dictionary.size casesM)) (list.every? exhaustive? (dictionary.values casesM))) #Exhaustive |