Rely less on global symbols
@@ -63,10 +63,6 @@ export class List {
}
return desired == 0;
}
-
- isEmpty() {
- return "EmptyList" == this[symbols.variant];
- }
}
export function toList(elements, tail) {
@@ -77,6 +73,10 @@ export class Empty extends List {
get [symbols.variant]() {
return "EmptyList";
}
+
+ isEmpty() {
+ return true;
+ }
}
export class NonEmpty extends List {
@@ -89,6 +89,10 @@ export class NonEmpty extends List {
get [symbols.variant]() {
return "NonEmptyList";
}
+
+ isEmpty() {
+ return false;
+ }
}
export class BitString {
