monoid

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conform added in v0.0.4

func Conform[A any, CA Class[A]](c CA) func(t *testing.T, x, y, z A)

Conform returns a function testing if the implementation abides by its laws.

Types

type Class

type Class[A any] interface {
	semigroup.Class[A]

	MEmpty() A
	MAppend(A, A) A
	MConcat([]A) A
}

type MEmptyFn added in v0.0.4

type MEmptyFn[A any] func() A

type Type added in v0.0.4

type Type[A any] struct {
	// contains filtered or unexported fields
}

func NewType added in v0.0.4

func NewType[A any](
	sAssocFn semigroup.SAssocFn[A],
	mEmptyFn MEmptyFn[A],
) Type[A]

func (Type[A]) MAppend added in v0.0.4

func (t Type[A]) MAppend(x, y A) A

func (Type[A]) MConcat added in v0.0.4

func (t Type[A]) MConcat(xs []A) A

func (Type[A]) MEmpty added in v0.0.4

func (t Type[A]) MEmpty() A

func (Type[A]) SAssoc added in v0.0.4

func (t Type[A]) SAssoc(x, y A) A

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL