Skip to content

Can't convert type Map to type Sequence #21

Description

@jeroenvandijk

Found in https://github.com/Convex-Dev/convex.cljc/blob/main/module/break/src/test/clj/convex/test/break/coll.clj#L1216

This comes up with mapcat, but eventually also related to what map does see #20

Again a bit confusing (for me) especially since both concat and map work with a map.

(concat {:a 1} {:b 2}) ;=> [[:a 1] [:b 2]]
(concat (vec {:a 1}) (vec {:b 2})) ;=> [[:a 1] [:b 2]]
(mapcat identity {:a 1}) ;=> error
;; Mapcat is implemented as => 
(apply concat (empty {}) (apply map identity {:a 1} [])) ;=> error

;; Eventually

(apply concat {} {}) ;=> ; ERROR [CAST]: Can't convert argument at position 3 (with type Map) to type Sequence

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions