We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
natural_number.is
1 parent aa00c75 commit 5718fb0Copy full SHA for 5718fb0
src/language/semantics/prelude.ts
@@ -467,6 +467,24 @@ export const prelude: ObjectNode = makeObjectNode({
467
),
468
469
470
+ is: preludeFunction(
471
+ ['natural_number', 'is'],
472
+ {
473
+ parameter: types.something,
474
+ return: types.boolean,
475
+ },
476
+ argument =>
477
+ either.makeRight(
478
+ typeof argument === 'string' &&
479
+ types.naturalNumber.isAssignableFrom({
480
+ name: '',
481
+ kind: 'union',
482
+ members: new Set([argument]),
483
+ })
484
+ ? 'true'
485
+ : 'false',
486
+ ),
487
488
}),
489
490
object: makeObjectNode({
0 commit comments