Hyperlinkv0.8.0-beta.28

Boolean

Boolean.eqvconsteffect/Boolean.ts:342
(that: boolean): (self: boolean) => boolean
(self: boolean, that: boolean): boolean

Combines two booleans using EQV (aka XNOR): !xor(self, that).

When to use

Use to accept when both boolean operands have the same truth value.

Example (Checking boolean equivalence)

import { Boolean } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(Boolean.eqv(true, true), true)
assert.deepStrictEqual(Boolean.eqv(true, false), false)
assert.deepStrictEqual(Boolean.eqv(false, true), false)
assert.deepStrictEqual(Boolean.eqv(false, false), true)
combinators
Source effect/Boolean.ts:3424 lines
export const eqv: {
  (that: boolean): (self: boolean) => boolean
  (self: boolean, that: boolean): boolean
} = dual(2, (self: boolean, that: boolean): boolean => !xor(self, that))