Closed jdormit closed 1 year ago
I'm torn on whether to treat this as a bug or not.
On the one hand, the docstring for core mapcat
says "function f should return a collection", while the docstring for Manifold mapcat
says it's equivalent to clj mapcat
, which would exclude streams, as they're not colls.
On the other hand, that's kinda counter-intuitive to the idea that mapcat
should just be (apply concat (apply map ...
On the gripping hand... Manifold concat
only works with streams, not seqs, so a fn we used with core mapcat
wouldn't work with (s/concat (s/map ...
I think for now, maybe a docstring update will suffice, though if you craft a PR, it would be welcomed.
Can we consider this issue as closed? Or should we consider further adjusting mapcat?
@figurantpp Hmm, I left a comment on your PR saying "Closes #179", but it didn't work.
I must be missing something, but based on https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword, it seems like it should have closed this as soon as it was merged...
The
mapcat
function seems to choke if you pass in a mapping function that returns a stream instead of a sequence:However, if you express the same calculation as a composition of
concat
andmap
, it works fine:Am I misunderstanding the purpose of
mapcat
? Or should it be able to handle mapping functions that return streams?