sanctuary-js / sanctuary

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

Add intercalate #569

Closed masaeedu closed 4 years ago

masaeedu commented 6 years ago

Fixes #360

davidchambers commented 6 years ago

I think this function would be at home in sanctuary-type-classes. We could define it there first.

masaeedu commented 6 years ago

@davidchambers Do we want to add this as-is to sanctuary-type-classes or do the head/tail in-terms-of-Foldable stuff first and then try to define this on top? I can't think of what sort of things you'd use this for besides intercalating in lists.

Btw, looks like the CI is failing because of coverage, not sure I fully understand what the issue is.

Bradcomp commented 6 years ago

@masaeedu you need to add some tests to test/intercalate.js to cover the function. the Doctests don't count I think...

davidchambers commented 5 years ago

Do we want to add this as-is to sanctuary-type-classes or do the head/tail in-terms-of-Foldable stuff first and then try to define this on top?

The former, I believe. head and tail require sanctuary-maybe, which is not a dependency of sanctuary-type-classes.

@masaeedu, are you interested in putting together a pull request for Z.intercalate?

masaeedu commented 5 years ago

@davidchambers Sure, I can take a crack at it. It would go somewhere in here, right?

davidchambers commented 5 years ago

Yes, it would. :)