Skip to content

Latest commit

 

History

History
133 lines (83 loc) · 1.29 KB

Monoid.md

File metadata and controls

133 lines (83 loc) · 1.29 KB

MODULE Monoid

Monoid

type class

interface Monoid<A> extends Semigroup<A> {
  empty: A
}

getArrayMonoid

instance

getArrayMonoid = <A = never>():

Monoid under array concatenation (Array<any>)

monoidAll

instance

Monoid<boolean>

Boolean monoid under conjunction

monoidAny

instance

Monoid<boolean>

Boolean monoid under disjunction

monoidProduct

instance

Monoid<number>

Number monoid under multiplication

monoidString

instance

Monoid<string>

monoidSum

instance

Monoid<number>

Number monoid under addition

monoidVoid

instance

Monoid<void>

unsafeMonoidArray

instance

Monoid<Array<any>>

fold

function

<A>(M: Monoid<A>): ((as: Array<A>) => A)

getDualMonoid

function

<A>(M: Monoid<A>): Monoid<A>

getEndomorphismMonoid

function

<A = never>(): Monoid<Endomorphism<A>>

getFunctionMonoid

function

<M>(M: Monoid<M>) => <A = never>(): Monoid<(a: A) => M>

getProductMonoid

function

<A, B>(MA: Monoid<A>, MB: Monoid<B>): Monoid<[A, B]>

getRecordMonoid

function

<O>(Ms: { [K in keyof O]: Monoid<O[K]> }): Monoid<O>