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.
integer.is
1 parent 7d0c8f0 commit aa00c75Copy full SHA for aa00c75
src/language/semantics/prelude.ts
@@ -228,6 +228,24 @@ export const prelude: ObjectNode = makeObjectNode({
228
),
229
230
231
+ is: preludeFunction(
232
+ ['integer', 'is'],
233
+ {
234
+ parameter: types.something,
235
+ return: types.boolean,
236
+ },
237
+ argument =>
238
+ either.makeRight(
239
+ typeof argument === 'string' &&
240
+ types.integer.isAssignableFrom({
241
+ name: '',
242
+ kind: 'union',
243
+ members: new Set([argument]),
244
+ })
245
+ ? 'true'
246
+ : 'false',
247
+ ),
248
249
less_than: preludeFunction(
250
['integer', 'less_than'],
251
{
0 commit comments