package boolean

import "github.com/IBM/fp-go/boolean"

Index

Variables

var (
	// MonoidAny is the boolean [M.Monoid] under disjunction
	MonoidAny = M.MakeMonoid(
		func(l, r bool) bool {
			return l || r
		},
		false,
	)

	// MonoidAll is the boolean [M.Monoid] under conjuction
	MonoidAll = M.MakeMonoid(
		func(l, r bool) bool {
			return l && r
		},
		true,
	)

	// Eq is the equals predicate for boolean
	Eq = EQ.FromStrictEquals[bool]()

	// Ord is the strict ordering for boolean
	Ord = O.MakeOrd(func(l, r bool) int {
		if l {
			if r {
				return 0
			}
			return +1
		}
		if r {
			return -1
		}
		return 0
	}, func(l, r bool) bool {
		return l == r
	})
)

Source Files

boolean.go

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

Tools for package owners.