1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-25 22:21:49 +02:00
Files
fp-go/ioeither/generic/eq.go

18 lines
525 B
Go
Raw Normal View History

package generic
import (
ET "github.com/IBM/fp-go/either"
EQ "github.com/IBM/fp-go/eq"
G "github.com/IBM/fp-go/io/generic"
)
// Eq implements the equals predicate for values contained in the IOEither monad
func Eq[GA ~func() ET.Either[E, A], E, A any](eq EQ.Eq[ET.Either[E, A]]) EQ.Eq[GA] {
return G.Eq[GA](eq)
}
// FromStrictEquals constructs an `Eq` from the canonical comparison function
func FromStrictEquals[GA ~func() ET.Either[E, A], E, A comparable]() EQ.Eq[GA] {
return Eq[GA](ET.FromStrictEquals[E, A]())
}