aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/language/compiler/analysis/case
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/language/compiler/analysis/case/coverage.lux24
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux b/stdlib/source/lux/language/compiler/analysis/case/coverage.lux
index b718c382d..c19003df6 100644
--- a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux
+++ b/stdlib/source/lux/language/compiler/analysis/case/coverage.lux
@@ -32,12 +32,12 @@
_
{#///.lefts lefts
- #///.right? false
+ #///.right? #0
#///.value valueP})
(#.Right valueP)
{#///.lefts lefts
- #///.right? true
+ #///.right? #1
#///.value valueP})))
## The coverage of a pattern-matching expression summarizes how well
@@ -64,10 +64,10 @@
(-> Coverage Bit)
(case coverage
(#Exhaustive _)
- true
+ #1
_
- false))
+ #0))
(def: #export (determine pattern)
(-> Pattern (Operation Coverage))
@@ -87,8 +87,8 @@
[#///.Frac]
[#///.Text])
- ## Bits are the exception, since there is only "true" and
- ## "false", which means it is possible for bit
+ ## 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))
(operation/wrap (#Bit value))
@@ -149,7 +149,7 @@
(def: (= reference sample)
(case [reference sample]
[#Exhaustive #Exhaustive]
- true
+ #1
[(#Bit sideR) (#Bit sideS)]
(bit/= sideR sideS)
@@ -172,7 +172,7 @@
(list.zip2 flatR flatS))))
_
- false)))
+ #0)))
(open: "C/" Equivalence<Coverage>)
@@ -228,15 +228,15 @@
[(#Seq leftA rightA) (#Seq leftSF rightSF)]
(case [(C/= leftSF leftA) (C/= rightSF rightA)]
## There is nothing the addition adds to the coverage.
- [true true]
+ [#1 #1]
redundant-pattern
## The 2 sequences cannot possibly be merged.
- [false false]
+ [#0 #0]
(error/wrap (#Alt so-far addition))
## Same prefix
- [true false]
+ [#1 #0]
(do e.Monad<Error>
[rightM (merge rightA rightSF)]
(if (exhaustive? rightM)
@@ -247,7 +247,7 @@
(wrap (#Seq leftSF rightM))))
## Same suffix
- [false true]
+ [#0 #1]
(do e.Monad<Error>
[leftM (merge leftA leftSF)]
(wrap (#Seq leftM rightA))))