lambda_types/
datatypes.rs1
2
3use crate::{
4 primitives::Constant,
5 boolean::{True, False},
6 define
7};
8
9define! {
10 pub fn Pair ::= { X. Y. F. { F, X, Y }} where
15 F: X,
16 {F, X}: Y;
17 pub fn First ::= { P. { P, True }} where P: True;
23 pub fn Second ::= { P. { P, False }} where P: False;
29 pub fn Null ::= { P. { P, Constant<Constant<False>> }} where P: (Constant<Constant<False>>);
35}
36
37pub type Nil = Constant<True>;
39
40#[test]
41fn t() {
42 use crate::prelude::*;
43
44 let _: call!{ Null, Nil } = True::default();
45 let _: call!{ Null, {Pair, (), Nil} } = False::default();
46}