pub trait Pure<A> {
fn pure(value: A) -> Self;
}
Expand description
Pure
lets you construct a value of type F<A>
from a single value of
A
.
For instance:
Option::pure(5)
returnsSome(5)
.Result::pure(5)
returnsOk(5)
.Vec::pure(5)
returnsvec![5]
.