Hyperlinkv0.8.0-beta.28

Boolean

Boolean.andconsteffect/Boolean.ts:207
(that: boolean): (self: boolean) => boolean
(self: boolean, that: boolean): boolean

Combines two booleans using logical AND: self && that.

When to use

Use to require both boolean operands to be true.

Details

Supports both data-first and data-last forms.

Example (Combining booleans with AND)

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

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