MCPcopy Index your code
hub / github.com/Effect-TS/effect / fromSemigroup

Function fromSemigroup

packages/typeclass/src/Monoid.ts:21–26  ·  view source on GitHub ↗
(S: Semigroup<A>, empty: Monoid<A>["empty"])

Source from the content-addressed store, hash-verified

19 * @since 0.24.0
20 */
21export const fromSemigroup = <A>(S: Semigroup<A>, empty: Monoid<A>["empty"]): Monoid<A> => ({
22 combine: S.combine,
23 combineMany: S.combineMany,
24 empty,
25 combineAll: (collection) => S.combineMany(empty, collection)
26})
27
28/**
29 * Get a monoid where `combine` will return the minimum, based on the provided bounded order.

Callers 6

minFunction · 0.85
maxFunction · 0.85
reverseFunction · 0.85
tupleFunction · 0.85
arrayFunction · 0.85
structFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected