testing

package
v2.13.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertComposition deprecated

func AssertComposition[HKTA, HKTB, HKTC, A, B, C any](
	t *testing.T,

	eq E.Eq[HKTC],

	fab func(HKTA, func(A) B) HKTB,
	fac func(HKTA, func(A) C) HKTC,
	fbc func(HKTB, func(B) C) HKTC,
	ab func(A) B,
	bc func(B) C,
) func(fa HKTA) bool

Functor composition law

F.map(fa, a => bc(ab(a))) <-> F.map(F.map(fa, ab), bc)

Deprecated: use FunctorAssertComposition instead

func AssertIdentity deprecated

func AssertIdentity[HKTA, A any](t *testing.T, eq E.Eq[HKTA], fmap func(HKTA, func(A) A) HKTA) func(fa HKTA) bool

Functor identity law

F.map(fa, a => a) <-> fa

Deprecated: use FunctorAssertIdentity

func AssertLaws deprecated

func AssertLaws[HKTA, HKTB, HKTC, A, B, C any](t *testing.T,
	eqa E.Eq[HKTA],
	eqc E.Eq[HKTC],

	faa func(HKTA, func(A) A) HKTA,
	fab func(HKTA, func(A) B) HKTB,
	fac func(HKTA, func(A) C) HKTC,
	fbc func(HKTB, func(B) C) HKTC,

	ab func(A) B,
	bc func(B) C,
) func(fa HKTA) bool

AssertLaws asserts the functor laws `identity` and `composition`

Deprecated: use FunctorAssertLaws instead

func FunctorAssertComposition

func FunctorAssertComposition[HKTA, HKTB, HKTC, A, B, C any](
	t *testing.T,

	eq E.Eq[HKTC],

	fab functor.Functor[A, B, HKTA, HKTB],
	fac functor.Functor[A, C, HKTA, HKTC],
	fbc functor.Functor[B, C, HKTB, HKTC],

	ab func(A) B,
	bc func(B) C,
) func(fa HKTA) bool

Functor composition law

F.map(fa, a => bc(ab(a))) <-> F.map(F.map(fa, ab), bc)

func FunctorAssertIdentity

func FunctorAssertIdentity[HKTA, A any](
	t *testing.T,
	eq E.Eq[HKTA],

	fca functor.Functor[A, A, HKTA, HKTA],
) func(fa HKTA) bool

Functor identity law

F.map(fa, a => a) <-> fa

func FunctorAssertLaws

func FunctorAssertLaws[HKTA, HKTB, HKTC, A, B, C any](t *testing.T,
	eqa E.Eq[HKTA],
	eqc E.Eq[HKTC],

	faa functor.Functor[A, A, HKTA, HKTA],
	fab functor.Functor[A, B, HKTA, HKTB],
	fac functor.Functor[A, C, HKTA, HKTC],
	fbc functor.Functor[B, C, HKTB, HKTC],

	ab func(A) B,
	bc func(B) C,
) func(fa HKTA) bool

FunctorAssertLaws asserts the functor laws `identity` and `composition`

Types

This section is empty.

Jump to

Keyboard shortcuts

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