pub fn is_some() -> Term
Expand description

Applied to a lambda-encoded option it produces a lambda-encoded boolean indicating whether it is not empty.

IS_SOME ≡ λa.a FALSE (λx.TRUE) ≡ λ 1 FALSE (λ TRUE)

Example

use lambda_calculus::data::option::{is_some, none};
use lambda_calculus::*;

assert_eq!(beta(app(is_some(), none()), NOR, 0), false.into());
assert_eq!(beta(app(is_some(), Some(2).into_church()), NOR, 0), true.into());