sanctuary-js / sanctuary

:see_no_evil: Refuge from unsafe JavaScript
https://sanctuary.js.org
MIT License
3.03k stars 94 forks source link

array: generalize S.head, S.last, S.tail, and S.init #610

Closed syves closed 5 years ago

syves commented 5 years ago

Closes #570

Initial attempt to generalize head, tail, last and init functions for Foldables.

syves commented 5 years ago

I've addressed the above changes, but for some reason doctest is not running.

20 error code ELIFECYCLE 21 error errno 1 22 error sanctuary@1.0.0 doctest: sanctuary-doctest 22 error Exit status 1 23 error Failed at the sanctuary@1.0.0 doctest script.

davidchambers commented 5 years ago

Let's complete this pull request together. I will push some commits to your branch. :)

davidchambers commented 5 years ago

I just added fast paths for arrays, so these functions will continue to operate efficiently on arrays. @syves, if you're happy with these changes please squash the commits in preparation for merging. :)

davidchambers commented 5 years ago

Thank you, @syves!