1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-27 22:28:29 +02:00
Files
fp-go/readerioeither/generic/eq.go
Dr. Carsten Leue b25de3c7c3 doc: fix case
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
2023-07-18 15:57:54 +02:00

18 lines
603 B
Go

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