What does colls mean in the clojure documentation?

Viewed 76

In the dos of mapcat you see colls. What does it mean?

clojure.core/mapcat
 [f]
 [f & colls]
1 Answers

Colls means any number of collections. So mapcat can be called with

  • only a function. In this case, it returns a transducer.
  • with a function and a collection: it returns a sequence of concatenated results of calling the function on each element of the collection.
  • with a function and multiple collections: similarly to the above, the result is the concatenation of results of invoking the function with first argument taken from the first collection, second arg from second coll, etc.
Related