hemanth / functional-programming-jargon

Jargon from the functional programming world in simple terms!
http://git.io/fp-jargons
MIT License
18.58k stars 1.02k forks source link

Is array concatenation a monoid? #243

Open thanhnguyen2187 opened 1 year ago

thanhnguyen2187 commented 1 year ago

I'm not so sure about the monoid section, where it's stated that:

Array concatenation also forms a monoid

With the example:

[1, 2].concat([3, 4])

I don't feel like array concatenation satisfies "associativity" at all, since a.concat(b) clearly differs from b.concat(a). Can someone explain this for me?