import * as T from "../../Effect/index.js"; import * as O from "../../Option/index.js"; import * as ST from "../../Structural/index.js"; import * as PR from "../Primitives/index.js"; export declare const BoolAlgebraTypeId: unique symbol; export declare const ValueTypeId: unique symbol; export declare const AndTypeId: unique symbol; export declare const OrTypeId: unique symbol; export declare const NotTypeId: unique symbol; export declare function concrete(_: BoolAlgebra): asserts _ is typeof _[typeof PR._C]; /** * A `BoolAlgebra` is a description of logical operations on values of type * `A`. */ export declare abstract class BoolAlgebra implements ST.HasEquals { readonly [BoolAlgebraTypeId]: typeof BoolAlgebraTypeId; readonly [PR._A]: () => A; readonly [PR._C]: Value | And | Or | Not; abstract [ST.equalsSym](that: unknown): boolean; get [ST.hashSym](): number; ["&&"](that: BoolAlgebra): BoolAlgebra; ["||"](that: BoolAlgebra): BoolAlgebra; get ["!"](): BoolAlgebra; } export declare class Value extends BoolAlgebra { readonly value: A; readonly typeId: typeof ValueTypeId; constructor(value: A); [ST.equalsSym](that: unknown): boolean; get [ST.hashSym](): number; private equal; } export declare function isValue(a: BoolAlgebra): a is Value; export declare class And extends BoolAlgebra { readonly left: BoolAlgebra; readonly right: BoolAlgebra; readonly typeId: typeof AndTypeId; constructor(left: BoolAlgebra, right: BoolAlgebra); [ST.equalsSym](that: unknown): boolean; private equal; private static associative; private commutative; private static distributive; private deMorgansLaws; } export declare function isAnd(a: BoolAlgebra): a is And; export declare class Or extends BoolAlgebra { readonly left: BoolAlgebra; readonly right: BoolAlgebra; readonly typeId: typeof OrTypeId; constructor(left: BoolAlgebra, right: BoolAlgebra); [ST.equalsSym](that: unknown): boolean; private equal; private static associative; private commutative; private static distributive; private deMorgansLaws; } export declare function isOr(a: BoolAlgebra): a is Or; export declare class Not extends BoolAlgebra { readonly result: BoolAlgebra; readonly typeId: typeof NotTypeId; constructor(result: BoolAlgebra); [ST.equalsSym](that: unknown): boolean; private equal; private deMorgansLaws; } export declare function isNot(a: BoolAlgebra): a is Not; export declare function isBoolAlgebra(a: unknown): a is BoolAlgebra; /** * Returns a new result, with all values mapped to the specified constant. */ export declare function as_(self: BoolAlgebra, b: B): BoolAlgebra; /** * Returns a new result, with all values mapped to the specified constant. */ export declare function as(b: B): (self: BoolAlgebra) => BoolAlgebra; /** * If this result is a success returns `None`. If it is a failure returns a * new result containing all failures that are relevant to this result being * a failure. */ export declare function failures(self: BoolAlgebra): O.Option>; /** * Returns a new result, with all values mapped to new results using the * specified function. */ export declare function chain_(self: BoolAlgebra, f: (a: A) => BoolAlgebra): BoolAlgebra; /** * Returns a new result, with all values mapped to new results using the * specified function. */ export declare function chain(f: (a: A) => BoolAlgebra): (self: BoolAlgebra) => BoolAlgebra; /** * Returns a new result, with all values mapped to new results using the * specified effectual function. */ export declare function chainM_(self: BoolAlgebra, f: (a: A) => T.Effect>): T.Effect>; /** * Returns a new result, with all values mapped to new results using the * specified effectual function. */ export declare function chainM(f: (a: A) => T.Effect>): (self: BoolAlgebra) => T.Effect>; /** * Folds over the result bottom up, first converting values to `B` * values, and then combining the `B` values, using the specified functions. */ export declare function fold_(self: BoolAlgebra, caseValue: (a: A) => B, caseAnd: (b1: B, b2: B) => B, caseOr: (b1: B, b2: B) => B, caseNot: (b: B) => B): B; /** * Folds over the result bottom up, first converting values to `B` * values, and then combining the `B` values, using the specified functions. */ export declare function fold(caseValue: (a: A) => B, caseAnd: (b1: B, b2: B) => B, caseOr: (b1: B, b2: B) => B, caseNot: (b: B) => B): (self: BoolAlgebra) => B; export declare function implies_(self: BoolAlgebra, that: BoolAlgebra): BoolAlgebra; export declare function implies(that: BoolAlgebra): (self: BoolAlgebra) => BoolAlgebra; export declare function iff_(self: BoolAlgebra, that: BoolAlgebra): BoolAlgebra; export declare function iff(that: BoolAlgebra): (self: BoolAlgebra) => BoolAlgebra; /** * Determines whether the result is a failure, where values represent success * and are combined using logical conjunction, disjunction, and negation. */ export declare function isFailure(self: BoolAlgebra): boolean; /** * Determines whether the result is a success, where values represent success * and are combined using logical conjunction, disjunction, and negation. */ export declare function isSuccess(self: BoolAlgebra): boolean; /** * Returns a new result, with all values mapped by the specified function. */ export declare function map_(self: BoolAlgebra, f: (a: A) => B): BoolAlgebra; /** * Returns a new result, with all values mapped by the specified function. */ export declare function map(f: (a: A) => B): (self: BoolAlgebra) => BoolAlgebra; /** * Returns a new result, with all values mapped by the specified effectual * function. */ export declare function mapM_(self: BoolAlgebra, f: (a: A) => T.Effect): T.Effect>; /** * Returns a new result, with all values mapped by the specified effectual * function. */ export declare function mapM(f: (a: A) => T.Effect): (self: BoolAlgebra) => T.Effect>; /** * Returns a result that is the logical conjunction of all of the results in * the specified collection. */ export declare function all(as: Iterable>): O.Option>; /** * Constructs a result that is the logical conjunction of two results. */ export declare function and_(left: BoolAlgebra, right: BoolAlgebra): BoolAlgebra; /** * Constructs a result that is the logical conjunction of two results. */ export declare function and(right: BoolAlgebra): (left: BoolAlgebra) => BoolAlgebra; /** * Returns a result that is the logical disjunction of all of the results in * the specified collection. */ export declare function any(as: Iterable>): O.Option>; /** * Combines a collection of results to create a single result that succeeds * if all of the results succeed. */ export declare function collectAll(as: Iterable>): O.Option>; /** * Constructs a failed result with the specified value. */ export declare function failure(a: A): BoolAlgebra; /** * Applies the function `f` to each element of the `Iterable[A]` to produce * a collection of results, then combines all of those results to create a * single result that is the logical conjunction of all of the results. */ export declare function forEach(as: Iterable, f: (a: A) => BoolAlgebra): O.Option>; /** * Constructs a result that is the logical negation of the specified result. */ export declare function not(result: BoolAlgebra): BoolAlgebra; /** * Constructs a result a that is the logical disjunction of two results. */ export declare function or_(left: BoolAlgebra, right: BoolAlgebra): BoolAlgebra; /** * Constructs a result a that is the logical disjunction of two results. */ export declare function or(right: BoolAlgebra): (left: BoolAlgebra) => BoolAlgebra; /** * Constructs a successful result with the specified value. */ export declare function success(a: A): BoolAlgebra; /** * A successful result with the unit value. */ export declare const unit: BoolAlgebra; //# sourceMappingURL=index.d.ts.map