effect-io-ai

Package: effect
Module: Predicate

Predicate.eqv

Creates a predicate that returns true when both predicates agree.

When to use

Use when you want to check equivalence of two Predicates.

Details

Returns true when both results are equal.

Example (Defining equivalence)

import { Predicate } from "effect"

const isEven = (n: number) => n % 2 === 0
const same = Predicate.eqv(isEven, isEven)

console.log(same(3))

See

Signature

declare const eqv: { <A>(that: Predicate<A>): (self: Predicate<A>) => Predicate<A>; <A>(self: Predicate<A>, that: Predicate<A>): Predicate<A>; }

Source

Since v2.0.0