Hyperlinkv0.8.0-beta.28

Boolean

Boolean.nandconsteffect/Boolean.ts:234
(that: boolean): (self: boolean) => boolean
(self: boolean, that: boolean): boolean

Combines two booleans using NAND: !(self && that).

When to use

Use to negate a logical AND result.

Example (Combining booleans with NAND)

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

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