import { toNative as $n, L, P, _, fromNative as _n } from './core'; export type Bool = L<(t: T) => L<(f: T) => T>>; export const True: Bool = _(t => _(_f => t)) as Bool; export const False: Bool = _(_t => _(f => f)); export const iif: L<(b: Bool) => L<(t: T) => L<(f: T) => T>>> = _(b => _(t => _(f => b._(t)._(f)))); export const eq: L<(l: Bool) => L<(r: Bool) => Bool>> = _(l => _(r => l._(r)._(not._(r)))) export const not: L<(b: Bool) => Bool> = _(b => b._(False)._(True)); export const and: L<(l: Bool) => L<(r: Bool) => Bool>> = _(l => _(r => l._(r)._(False))); export const or: L<(l: Bool) => L<(r: Bool) => Bool>> = _(l => _(r => l._(True)._(r))); export const xor: L<(l: Bool) => L<(r: Bool) => Bool>> = _(l => _(r => l._(not._(r))._(r))); export const fromBoolean: (b: boolean) => Bool = b => b ? True : False; export const toBoolean: (b: Bool) => boolean = b => $n(b._(_n(true))._(_n(false)));