We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there the opposite for cons? which will insert an element into beginning? And if no, what's the shades-style to achieve it?
cons
The text was updated successfully, but these errors were encountered:
As of shades@2.1.0-beta.1, there's an unshift function!
unshift
> unshift(1)([2, 3, 4]) [1, 2, 3, 4]
You can grab it by doing
npm install shades@beta
Or if you want to stick with the stable branch, you can do:
> prepend([1])([2, 3, 4]) [1, 2, 3, 4]
Note that prepend requires that the first element be a list as well.
Sorry, something went wrong.
ah, thanks! missed the prepend or was not aware that it's what I need. Ended up by using
prepend
x => xs => [x, ...xs]
which is pretty concise too.
offtop suggestion: Table of contents for API would be helpful. To see all the methods at a glance
No branches or pull requests
Is there the opposite for
cons
? which will insert an element into beginning?And if no, what's the shades-style to achieve it?
The text was updated successfully, but these errors were encountered: