use crate::{Incomplete, Pipe};
use fatal_error::FatalError;
use std::error::Error as StdError;
pub trait Tag<T, E> {
type Output;
fn strip_from(&self, input: T) -> Result<(T, (Self::Output,)), E>;
}
pub fn tag<E, I, T: Tag<I, E>>(tag: T) -> impl Pipe<I, (T::Output,), E>
where
E: StdError,
Incomplete: Into<E>,
{
move |i: I| tag.strip_from(i).map_err(FatalError::Error)
}