Macro rust2fun::constant1

source ·
macro_rules! constant1 {
    ($x:expr) => { ... };
}
Expand description

The constant function constant1(x) = _ -> x also known as K (Kestrel) combinator.

Example

use rust2fun::prelude::*;

let actual = Some(1).map(constant1!(2));
assert_eq!(Some(2), actual);