I understand the equivalent to flatMap in Scala is mapcat in Clojure.
I have an inkling that mapcat in clojure only works with sequences, unlike flatMap in Scala which is more flexible.
My question is - what are the differences between mapcat in Clojure and flatMap in Scala in terms of what they operate on?
Assumptions:
- I understand that Scala has a rich type system and Clojure has optional typing - I'm interested to know if the is a limitation in the parameters that mapcat accepts that make it only have a subset of
flatMaps functionality.
mapcatandmapin Clojure, but it isn't a part of the meaning offlatMapandmapin Scala. I am not saying that Clojure does anything wrong, worse than Scala, that it should have one name for these operations just because Scala does, etc.