MostlyAdequate / mostly-adequate-guide

Mostly adequate guide to FP (in javascript)
Other
23.3k stars 1.86k forks source link

`id` function does not exist (Chapter 8) #623

Open klequis opened 2 years ago

klequis commented 2 years ago

In chapter 8 the final code example before "Old McDonald..." has this line

const zoltar = compose(console.log, either(id, fortune), getAge(moment()));

However, the support functions do not have an id function. They do have an identity function. I'm wondering if the line in the code example should actually be using identity:

const zoltar = compose(console.log, either(identity, fortune), getAge(moment()));

I'm running the code in a Node project where I just copied in all the support files from the repo.