Function frunk::generic::map_inter

source ·
pub fn map_inter<Inter, Origin, Mapper>(val: Origin, mapper: Mapper) -> Origin
where Origin: Generic, Inter: Generic<Repr = <Origin as Generic>::Repr>, Mapper: FnOnce(Inter) -> Inter,
Expand description

Maps a value of a given type Origin using a function on a type Inter which has the same representation type of Origin.

Note that the compiler will have a hard time inferring the type variable Inter. Thus, using map_inter is mostly effective if the type is constrained by the input function or by the body of a lambda.