Skip to content

Commit

Permalink
fix docs for Poly move
Browse files Browse the repository at this point in the history
  • Loading branch information
ExpHP committed Apr 10, 2018
1 parent b73f022 commit bdb8b0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/src/coproduct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ impl<Head, Tail> Coproduct<Head, Tail> {
/// * A single closure (for a Coproduct that is homogenous).
/// * A single [`Poly`].
///
/// [`Poly`]: ../hlist/struct.Poly.html
/// [`Poly`]: ../traits/struct.Poly.html
///
/// # Example
///
Expand Down
3 changes: 1 addition & 2 deletions core/src/hlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ macro_rules! gen_inherent_methods {
/// * A single closure (for mapping an HList that is homogenous).
/// * A single [`Poly`].
///
/// [`Poly`]: struct.Poly.html
/// [`Poly`]: ../traits/struct.Poly.html
///
/// # Examples
///
Expand Down Expand Up @@ -474,7 +474,6 @@ macro_rules! gen_inherent_methods {
/// f1( x1, f2( x2, f3( x3, ... fN( xN, init))...)))
/// ```
///
/// [`Poly`]: struct.Poly.html
/// [`HNil`]: struct.HNil.html
/// [`h_cons`]: fn.h_cons.html
///
Expand Down
18 changes: 8 additions & 10 deletions core/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
/// that sometimes occur when trying to implement a trait for &'a T (see this comment:
/// https://github.com/lloydmeta/frunk/pull/106#issuecomment-377927198)
///
/// This is essentially From, but the more specific nature of it means it's more ergonomic
/// in actual usage.
///
/// Implemented for HLists.
///
/// This functionality is also provided as an [inherent method].
/// This functionality is also provided as an inherent method [on HLists] and [on Coproducts].
/// However, you may find this trait useful in generic contexts.
///
/// [inherent method]: struct.HCons.html#method.to_ref
/// [on HLists]: ../hlist/struct.HCons.html#method.to_ref
/// [on Coproducts]: ../coproduct/enum.Coproduct.html#method.to_ref
pub trait ToRef<'a> {
type Output;

Expand All @@ -29,7 +25,7 @@ pub trait ToRef<'a> {
/// This functionality is also provided as an [inherent method].
/// However, you may find this trait useful in generic contexts.
///
/// [inherent method]: struct.HCons.html#method.into_reverse
/// [inherent method]: ../hlist/struct.HCons.html#method.into_reverse
pub trait IntoReverse {
type Output;

Expand All @@ -41,11 +37,13 @@ pub trait IntoReverse {
///
/// This is a thin generic wrapper type that is used to differentiate
/// between single-typed generic closures `F` that implements, say, `Fn(i8) -> bool`,
/// and a Poly-typed `F` that implements multiple Function types, say
/// `Func<i8, Output=bool>`, `Func<bool, Output=f32>` etc.
/// and a Poly-typed `F` that implements multiple Function types
/// via the [`Func`] trait. (say, `Func<i8, Output=bool>` and `Func<bool, Output=f32>`)
///
/// This is needed because there are completely generic impls for many of the
/// HList traits that take a simple unwrapped closure.
///
/// [`Func`]: trait.Func.html
#[derive(Debug, Copy, Clone, Default)]
pub struct Poly<T>(pub T);

Expand Down

0 comments on commit bdb8b0f

Please sign in to comment.