use crate::{LensOver, LensTrait, LensView}; #[allow(non_camel_case_types)] #[derive(Clone, Copy)] pub struct id; impl LensTrait for id {} impl LensView for id { type Field = T; fn view(thing: T) -> Self::Field { thing } } impl LensOver for id { fn over(thing: T, f: F) -> T where F: FnOnce(Self::Field) -> Self::Field, { f(thing) } }