File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,24 @@ export const prelude: ObjectNode = makeObjectNode({
228228 ) ,
229229 ) ,
230230 ) ,
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+ ) ,
231249 less_than : preludeFunction (
232250 [ 'integer' , 'less_than' ] ,
233251 {
@@ -449,6 +467,24 @@ export const prelude: ObjectNode = makeObjectNode({
449467 ) ,
450468 ) ,
451469 ) ,
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+ ) ,
452488 } ) ,
453489
454490 object : makeObjectNode ( {
You can’t perform that action at this time.
0 commit comments