magma

package
v1.0.117 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcatAll

func ConcatAll[A any](m Magma[A]) func(A) func([]A) A

ConcatAll concats all items using the semigroup and a starting value

func Endo

func Endo[A any](f func(A) A) func(Magma[A]) Magma[A]

func FilterFirst

func FilterFirst[A any](p func(A) bool) func(Magma[A]) Magma[A]

func FilterSecond

func FilterSecond[A any](p func(A) bool) func(Magma[A]) Magma[A]

func GenericConcatAll

func GenericConcatAll[GA ~[]A, A any](m Magma[A]) func(A) func(GA) A

GenericConcatAll concats all items using the semigroup and a starting value

func GenericMonadConcatAll

func GenericMonadConcatAll[GA ~[]A, A any](m Magma[A]) func(GA, A) A

func MonadConcatAll

func MonadConcatAll[A any](m Magma[A]) func([]A, A) A

Types

type Magma

type Magma[A any] interface {
	Concat(x A, y A) A
}

func First

func First[A any]() Magma[A]

func MakeMagma

func MakeMagma[A any](c func(A, A) A) Magma[A]

func Reverse

func Reverse[A any](m Magma[A]) Magma[A]

func Second

func Second[A any]() Magma[A]

Jump to

Keyboard shortcuts

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