use crate::{Pred, Pred2};
std_prelude!();
#[derive(Clone, Copy, Debug, Default)]
pub struct Increasing;
impl<T: PartialOrd + ?Sized> Pred2<T> for Increasing {
fn accept(a: &T, b: &T) -> bool {
a.le(b)
}
}
#[derive(Clone, Copy, Debug, Default)]
pub struct Decreasing;
impl<T: PartialOrd + ?Sized> Pred2<T> for Decreasing {
fn accept(a: &T, b: &T) -> bool {
a.ge(b)
}
}
#[derive(Clone, Copy, Debug, Default)]
pub struct True;
impl<T> Pred<T> for True {
fn accept(_: &T) -> bool {
true
}
}
#[derive(Clone, Copy, Debug, Default)]
pub struct False;
impl<T> Pred<T> for False {
fn accept(_: &T) -> bool {
false
}
}
mod iter;
pub use iter::*;
#[cfg(feature = "num-integer")]
mod integer;
#[cfg(feature = "num-integer")]
pub use integer::*;
pub type Ascending = AllAdj<Increasing>;
pub type Descending = AllAdj<Decreasing>;