Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/// Helper trait to allow Appending of tuples
pub trait Append<T> {
type Output : PluckTail<Head = Self, Tail = T>;
type Output;
/// Append T onto the end of the tuple returning
/// a new tuple with the existing elements and T
fn append(self, other: T) -> Self::Output;
Expand All @@ -12,15 +12,15 @@ pub trait Append<T> {
///
/// This is the inverse of [`Append`]
pub trait PluckTail {
type Head : Append<Self::Tail, Output = Self>;
type Head;
type Tail;
/// Split the tuple into the tail (`Tail`) and the rest part (`Head`)
fn pluck_tail(self) -> (Self::Head, Self::Tail);
}

/// Helper trait to allow Perpending of tuples
pub trait Prepend<T> {
type Output : Pluck<Head = T, Tail = Self>;
type Output;
/// Append T onto the start of the tuple returning
/// a new tuple with all the elements from shifted
/// over one row and T in the first slot
Expand All @@ -32,7 +32,7 @@ pub trait Prepend<T> {
/// This is the inverse of [`Prepend`]
pub trait Pluck {
type Head;
type Tail : Prepend<Self::Head, Output = Self>;
type Tail;
/// Split the tuple into the head (`Head`) and the rest part (`Tail`)
fn pluck(self) -> (Self::Head, Self::Tail);
}
Expand Down