Skip to content

Commit 0f0298f

Browse files
committed
Rename the string type to atom
1 parent bb78ac9 commit 0f0298f

File tree

7 files changed

+160
-167
lines changed

7 files changed

+160
-167
lines changed

src/end-to-end.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ testCases(endToEnd, code => code)('end-to-end tests', [
7575
either.makeRight('output'),
7676
],
7777
[':match({ a: A })({ tag: a, value: {} })', either.makeRight('A')],
78-
[':{string concatenate}(a)(b)', either.makeRight('ba')],
78+
[':{atom concatenate}(a)(b)', either.makeRight('ba')],
7979
[
80-
':flow({ :string.concatenate(a) :string.concatenate(b) })(z)',
80+
':flow({ :atom.concatenate(a) :atom.concatenate(b) })(z)',
8181
either.makeRight('zab'),
8282
],
8383
[

src/language/runtime/keywords.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const runtimeContext = makeObjectNode({
2929
arguments: makeObjectNode({
3030
lookup: makeFunctionNode(
3131
{
32-
parameter: types.string,
33-
return: types.option(types.string),
32+
parameter: types.atom,
33+
return: types.option(types.atom),
3434
},
3535
unserializableFunction,
3636
option.none,
@@ -71,8 +71,8 @@ const runtimeContext = makeObjectNode({
7171
environment: makeObjectNode({
7272
lookup: makeFunctionNode(
7373
{
74-
parameter: types.string,
75-
return: types.option(types.string),
74+
parameter: types.atom,
75+
return: types.option(types.atom),
7676
},
7777
unserializableFunction,
7878
option.none,

src/language/semantics/prelude.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ export const prelude: ObjectNode = makeObjectNode({
443443
['object', 'lookup'],
444444
{
445445
// TODO
446-
parameter: types.string,
446+
parameter: types.atom,
447447
return: types.something,
448448
},
449449
key => {
@@ -494,33 +494,30 @@ export const prelude: ObjectNode = makeObjectNode({
494494
),
495495
}),
496496

497-
string: makeObjectNode({
497+
atom: makeObjectNode({
498498
concatenate: preludeFunction(
499-
['string', 'concatenate'],
499+
['atom', 'concatenate'],
500500
{
501-
parameter: types.string,
501+
parameter: types.atom,
502502
return: makeFunctionType('', {
503-
parameter: types.string,
504-
return: types.string,
503+
parameter: types.atom,
504+
return: types.atom,
505505
}),
506506
},
507507
string2 =>
508508
either.makeRight(
509509
makeFunctionNode(
510510
{
511-
parameter: types.string,
512-
return: types.string,
511+
parameter: types.atom,
512+
return: types.atom,
513513
},
514-
serializePartiallyAppliedFunction(
515-
['string', 'concatenate'],
516-
string2,
517-
),
514+
serializePartiallyAppliedFunction(['atom', 'concatenate'], string2),
518515
option.none,
519516
string1 => {
520517
if (typeof string1 !== 'string' || typeof string1 !== 'string') {
521518
return either.makeLeft({
522519
kind: 'panic',
523-
message: 'concatenate received a non-string argument',
520+
message: 'concatenate received a non-atom argument',
524521
})
525522
} else {
526523
return either.makeRight(string1 + string2)

0 commit comments

Comments
 (0)