Is Clojure pervasively monodic?

A monoid is…

- A set,
S- An operation,
:•×S->SS- An element of
,S: 1 ->eS

…satisfying these laws:

- (a • b) • c = a • (b • c), for all a, b and c in
S• a = a = a •e, for all a ineS

Consider `concat`

:

`(concat (concat [:a] [:b]) [:c]) => [:a :b :c]`

(concat [:a] (concat [:b] [:c])) => [:a :b :c]

(concat [:a] []) => [:a]

(concat [] [:a]) => [:a]

(concat [] []) => []

For some operations, `nil`

can be used as an empty seq:

`(concat [:a] nil) => [:a]`

(concat nil [:a]) => [:a]

… and with car-position key lookups:

`(:a {:a 1}) => 1`

(:a nil) => nil

However, this is not true for car-position map or set applications:

`({:a 1} :a) => 1`

(#{:a} :a) => :a

(nil :a) => ERROR

Map is not strictly monoidic, but nil can be substituted for empty seqs:

`(map even? [1 2]) => [false true]`

(map even? nil) => ()