remove useless compose
This commit is contained in:
parent
3ac3def389
commit
5d9a0a10df
@ -53,17 +53,3 @@ impl<U: ApplicativeLA2, V: ApplicativeLA2> ApplicativeLA2 for CompositionClass<U
|
||||
U::la2(|ua, ub| V::la2(f, ua, ub), fa, fb)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn compose<'a>(f: impl 'a + Fn(i16) -> i32, g: impl 'a + Fn(i8) -> i16) -> impl 'a + Fn(i8) -> i32 {
|
||||
move |x| f(g(x))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_compose() {
|
||||
assert_eq!(compose(|x| (x + 5).into(), |x| (x + 3).into())(2), 10);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user