Note remaining prelude tests
+// TODO: test methods to be used by generated code
+// - result.isOk
+// - list.atLeastLength
+
const variant = globalThis.__gleam_prelude_variant || Symbol("gleam");
globalThis.__gleam_prelude_variant = variant;
@@ -95,7 +99,11 @@ class UtfCodepoint {
}
}
-class Result extends Record {}
+class Result extends Record {
+ isOk() {
+ return "Ok" === this[variant];
+ }
+}
class Ok extends Result {
[variant] = "Ok";
@@ -104,10 +112,6 @@ class Ok extends Result {
super();
this[0] = value;
}
-
- isOk() {
- return true;
- }
}
class Error extends Result {
@@ -117,10 +121,6 @@ class Error extends Result {
super();
this[0] = detail;
}
-
- isOk() {
- return false;
- }
}
function inspect(v) {
