hemanth / hemanth/functional-programming-jargon

Is array concatenation a monoid?

Open
#243 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
18.7k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the monoid section and its array-concatenation example. Clarify the distinction between associativity and commutativity, and consider whether the section needs revised wording; the explanation should resolve the reported confusion.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.