@@ -496,32 +496,72 @@ export const prelude: ObjectNode = makeObjectNode({
496496 } ) ,
497497
498498 atom : makeObjectNode ( {
499- concatenate : preludeFunction (
500- [ 'atom' , 'concatenate ' ] ,
499+ append : preludeFunction (
500+ [ 'atom' , 'append ' ] ,
501501 {
502502 parameter : types . atom ,
503503 return : makeFunctionType ( '' , {
504504 parameter : types . atom ,
505505 return : types . atom ,
506506 } ) ,
507507 } ,
508- string2 =>
508+ atomToAppend =>
509509 either . makeRight (
510510 makeFunctionNode (
511511 {
512512 parameter : types . atom ,
513513 return : types . atom ,
514514 } ,
515- serializePartiallyAppliedFunction ( [ 'atom' , 'concatenate ' ] , string2 ) ,
515+ serializePartiallyAppliedFunction ( [ 'atom' , 'append ' ] , atomToAppend ) ,
516516 option . none ,
517- string1 => {
518- if ( typeof string1 !== 'string' || typeof string1 !== 'string' ) {
517+ atomToAppendTo => {
518+ if (
519+ typeof atomToAppend !== 'string' ||
520+ typeof atomToAppendTo !== 'string'
521+ ) {
522+ return either . makeLeft ( {
523+ kind : 'panic' ,
524+ message : 'append received a non-atom argument' ,
525+ } )
526+ } else {
527+ return either . makeRight ( atomToAppendTo + atomToAppend )
528+ }
529+ } ,
530+ ) ,
531+ ) ,
532+ ) ,
533+ prepend : preludeFunction (
534+ [ 'atom' , 'prepend' ] ,
535+ {
536+ parameter : types . atom ,
537+ return : makeFunctionType ( '' , {
538+ parameter : types . atom ,
539+ return : types . atom ,
540+ } ) ,
541+ } ,
542+ atomToPrepend =>
543+ either . makeRight (
544+ makeFunctionNode (
545+ {
546+ parameter : types . atom ,
547+ return : types . atom ,
548+ } ,
549+ serializePartiallyAppliedFunction (
550+ [ 'atom' , 'prepend' ] ,
551+ atomToPrepend ,
552+ ) ,
553+ option . none ,
554+ atomToPrependTo => {
555+ if (
556+ typeof atomToPrepend !== 'string' ||
557+ typeof atomToPrependTo !== 'string'
558+ ) {
519559 return either . makeLeft ( {
520560 kind : 'panic' ,
521- message : 'concatenate received a non-atom argument' ,
561+ message : 'prepend received a non-atom argument' ,
522562 } )
523563 } else {
524- return either . makeRight ( string1 + string2 )
564+ return either . makeRight ( atomToPrepend + atomToPrependTo )
525565 }
526566 } ,
527567 ) ,
0 commit comments