-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lattices): make unit
()
a point lattice (#793)
- Loading branch information
1 parent
dc99c02
commit 016abee
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ mod point; | |
mod seq; | ||
pub mod set_union; | ||
pub mod test; | ||
mod unit; | ||
mod with_bot; | ||
mod with_top; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use crate::{IsBot, IsTop, LatticeFrom, LatticeOrd, Merge}; | ||
|
||
impl Merge<()> for () { | ||
fn merge(&mut self, _other: ()) -> bool { | ||
false | ||
} | ||
} | ||
|
||
impl LatticeOrd for () {} | ||
|
||
impl LatticeFrom<()> for () { | ||
fn lattice_from(other: ()) -> Self { | ||
other | ||
} | ||
} | ||
|
||
impl IsBot for () { | ||
fn is_bot(&self) -> bool { | ||
true | ||
} | ||
} | ||
|
||
impl IsTop for () { | ||
fn is_top(&self) -> bool { | ||
true | ||
} | ||
} |