Crates.io | materially |
lib.rs | materially |
version | 1.0.0 |
source | src |
created_at | 2024-04-26 04:01:59.960061 |
updated_at | 2024-04-26 18:13:04.881156 |
description | A macro for material implication |
homepage | https://github.com/Jules-Bertholet/materially |
repository | https://github.com/Jules-Bertholet/materially |
max_upload_size | |
id | 1220967 |
size | 17,938 |
materially
A macro for material implication.
a => b
("a
implies b
") means !a || b
.
use materially::implies as i;
assert!(i!(false => true));
assert!(i!(false => false));
assert!(i!(true => true));
assert!(!i!(true => false));
// Implication is right-associative
assert!(i!(false => false => false));
// let-chains style syntax is also supported
assert!(i!(let Some(a) = Some(17) => a > 3 => let None = Some(17) => false));