feat: add Semigroup algebraic structure - #593
Open
ghoullier wants to merge 1 commit into
Open
Conversation
ghoullier
force-pushed
the
ghoullier-feat-semigroup
branch
5 times, most recently
from
July 1, 2026 17:09
1aa6c9b to
47d0c98
Compare
ghoullier
force-pushed
the
ghoullier-feat-semigroup
branch
from
July 8, 2026 20:27
47d0c98 to
366cccb
Compare
Add Semigroup interface and concrete implementations (Sum, Product, Str) with full test coverage including associativity law verification. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ghoullier
force-pushed
the
ghoullier-feat-semigroup
branch
from
July 10, 2026 21:23
366cccb to
f4db211
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the
Semigroupalgebraic structure to the FP library.A Semigroup represents types that have an associative binary operation (
concat). For any valuesa,b,c:What's included
Semigroup<T>interface with aconcat(other: T): TmethodSum— combines numbers by additionProduct— combines numbers by multiplicationStr— combines strings by concatenationsrc/index.ts