fp_library/typeclasses/
pure.rs

1use crate::hkt::{Apply, Kind};
2
3pub trait Pure {
4	/// forall a. Pure f => a -> f a
5	fn pure<A>(a: A) -> Apply<Self, (A,)>
6	where
7		Self: Kind<(A,)>;
8}
9
10/// forall a. Pure f => a -> f a
11pub fn pure<Brand, A>(a: A) -> Apply<Brand, (A,)>
12where
13	Brand: Kind<(A,)> + Pure,
14{
15	Brand::pure(a)
16}