diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux | 27 |
1 files changed, 14 insertions, 13 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 dc654fd40..24dd3051a 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux +++ b/stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux @@ -15,8 +15,9 @@ [collection ["." list ("#/." functor fold)] ["." dictionary (#+ Dictionary)]]]] - ["." //// ("#/." monad)] - ["." /// (#+ Pattern Variant Operation)]) + ["." //// ("#/." monad) + [// + ["/" analysis (#+ Pattern Variant Operation)]]]) (exception: #export (invalid-tuple-pattern) "Tuple size must be >= 2") @@ -91,30 +92,30 @@ (def: #export (determine pattern) (-> Pattern (Operation Coverage)) (case pattern - (^or (#///.Simple #///.Unit) - (#///.Bind _)) + (^or (#/.Simple #/.Unit) + (#/.Bind _)) (/////wrap #Exhaustive) ## Primitive patterns always have partial coverage because there ## are too many possibilities as far as values go. (^template [<tag>] - (#///.Simple (<tag> _)) + (#/.Simple (<tag> _)) (/////wrap #Partial)) - ([#///.Nat] - [#///.Int] - [#///.Rev] - [#///.Frac] - [#///.Text]) + ([#/.Nat] + [#/.Int] + [#/.Rev] + [#/.Frac] + [#/.Text]) ## Bits are the exception, since there is only "#1" and ## "#0", which means it is possible for bit ## pattern-matching to become exhaustive if complementary parts meet. - (#///.Simple (#///.Bit value)) + (#/.Simple (#/.Bit value)) (/////wrap (#Bit value)) ## Tuple patterns can be exhaustive if there is exhaustiveness for all of ## their sub-patterns. - (#///.Complex (#///.Tuple membersP+)) + (#/.Complex (#/.Tuple membersP+)) (case (list.reverse membersP+) (^or #.Nil (#.Cons _ #.Nil)) (////.throw invalid-tuple-pattern []) @@ -136,7 +137,7 @@ ## Variant patterns can be shown to be exhaustive if all the possible ## cases are handled exhaustively. - (#///.Complex (#///.Variant [lefts right? value])) + (#/.Complex (#/.Variant [lefts right? value])) (do ////.monad [value-coverage (determine value) #let [idx (if right? |