DEV Community

Discussion on: [ The Art of the State ] Why it is impossible to write an Identity Function in JavaScript, and how to do it anyway

Collapse
 
kantord profile image
Daniel Kantor • Edited

I think there's a typo in your code example:

/* Ephemeral CPS style: */
const Tuple = (...xs) => (K) => (...xs);

That's still a syntax error. I think you meant:

/* Ephemeral CPS style: */
const Tuple = (...xs) => (K) => K(...xs);

Fascinating article by the way!

Collapse
 
rekreanto profile image
rekreanto • Edited

You are 100% correct! Thanks for pointing that out!