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