package generic

import "github.com/IBM/fp-go/endomorphism/generic"

Index

Functions

func Ap

func Ap[GA ~func(A) A, A any](fa A) func(GA) A

func Chain

func Chain[ENDO ~func(GA) GA, GA ~func(A) A, A any](f GA) ENDO

func Compose

func Compose[ENDO ~func(A) A, A any](f1, f2 ENDO) ENDO

func Curry2

func Curry2[GT1 ~func(T1) T1, FCT ~func(T0, T1) T1, T0, T1 any](f FCT) func(T0) GT1

Curry2 is a duplicate of [F.Curry2] but because of the type system it's not compatible otherwise

func Curry3

func Curry3[GT2 ~func(T2) T2, FCT ~func(T0, T1, T2) T2, T0, T1, T2 any](f FCT) func(T0) func(T1) GT2

Curry2 is a duplicate of [F.Curry2] but because of the type system it's not compatible otherwise

func Identity

func Identity[ENDO ~func(A) A, A any]() ENDO

func MonadAp

func MonadAp[GA ~func(A) A, A any](fab GA, fa A) A

func MonadChain

func MonadChain[GA ~func(A) A, A any](ma GA, f GA) GA

func Monoid

func Monoid[ENDO ~func(A) A, A any]() M.Monoid[ENDO]

Monoid for the Endomorphism where the `concat` operation is the usual function composition.

func Of

func Of[ENDO ~func(A) A, F ~func(A) A, A any](f F) ENDO

Of converts any function to an [Endomorphism]

func Semigroup

func Semigroup[ENDO ~func(A) A, A any]() S.Semigroup[ENDO]

Semigroup for the Endomorphism where the `concat` operation is the usual function composition.

func Unwrap

func Unwrap[F ~func(A) A, ENDO ~func(A) A, A any](f ENDO) F

Unwrap converts any [Endomorphism] to a normal function

func Wrap

func Wrap[ENDO ~func(A) A, F ~func(A) A, A any](f F) ENDO

Wrap converts any function to an [Endomorphism]

Source Files

curry.go endo.go monoid.go

Version
v1.0.151 (latest)
Published
Nov 23, 2024
Platform
linux/amd64
Imports
4 packages
Last checked
4 months ago

Tools for package owners.