fp-core 0.1.9

A library for functional programming in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub trait Extract<A> {
    fn extract(self) -> A;
}

impl<A> Extract<A> for Option<A> {
    fn extract(self) -> A {
        self.unwrap() // is there a better way to achieve this?
    }
}

impl<A, E> Extract<A> for Result<A, E> where E: std::fmt::Debug {
    fn extract(self) -> A {
        self.unwrap() // is there a better way to achieve this?
    }
}