fp_library/classes/send_ref_applicative.rs
1//! Thread-safe by-ref applicative functors, combining [`SendRefPointed`](crate::classes::SendRefPointed) and [`SendRefSemiapplicative`](crate::classes::SendRefSemiapplicative).
2//!
3//! This is the thread-safe counterpart of [`RefApplicative`](crate::classes::RefApplicative).
4
5#[fp_macros::document_module]
6mod inner {
7 use crate::classes::*;
8
9 /// A type that supports both thread-safe pure value injection (via reference)
10 /// and thread-safe by-ref function application within a context.
11 ///
12 /// This is the thread-safe counterpart of [`RefApplicative`].
13 /// Automatically implemented for any type implementing both
14 /// [`SendRefPointed`] and [`SendRefSemiapplicative`].
15 pub trait SendRefApplicative:
16 SendRefPointed + SendRefSemiapplicative + SendRefApplyFirst + SendRefApplySecond {
17 }
18
19 /// Blanket implementation of [`SendRefApplicative`].
20 #[document_type_parameters("The brand type.")]
21 impl<Brand> SendRefApplicative for Brand where
22 Brand: SendRefPointed + SendRefSemiapplicative + SendRefApplyFirst + SendRefApplySecond
23 {
24 }
25}
26
27pub use inner::*;