Trait HMap

Source
pub trait HMap<Out> {
    type Fun;

    // Required method
    fn hmap(self, f: &Self::Fun) -> Out;
}
Expand description

Implemented by higher order maps.

A higher order map takes common data structures such as vectors and lists and applies a function to every element.

This is implemented recursively, hence higher order maps.

Required Associated Types§

Source

type Fun

The out type.

Required Methods§

Source

fn hmap(self, f: &Self::Fun) -> Out

Maps structure.

Implementations on Foreign Types§

Source§

impl<T, U> HMap<[U; 2]> for [T; 2]
where T: HMap<U>,

Source§

type Fun = <T as HMap<U>>::Fun

Source§

fn hmap(self, f: &Self::Fun) -> [U; 2]

Source§

impl<T, U> HMap<[U; 3]> for [T; 3]
where T: HMap<U>,

Source§

type Fun = <T as HMap<U>>::Fun

Source§

fn hmap(self, f: &Self::Fun) -> [U; 3]

Source§

impl<T, U> HMap<[U; 4]> for [T; 4]
where T: HMap<U>,

Source§

type Fun = <T as HMap<U>>::Fun

Source§

fn hmap(self, f: &Self::Fun) -> [U; 4]

Source§

impl<T, U> HMap<[U; 5]> for [T; 5]
where T: HMap<U>,

Source§

type Fun = <T as HMap<U>>::Fun

Source§

fn hmap(self, f: &Self::Fun) -> [U; 5]

Source§

impl<T, U> HMap<[U; 6]> for [T; 6]
where T: HMap<U>,

Source§

type Fun = <T as HMap<U>>::Fun

Source§

fn hmap(self, fx: &Self::Fun) -> [U; 6]

Source§

impl<T, U> HMap<Vec<U>> for Vec<T>
where T: HMap<U>,

Source§

type Fun = <T as HMap<U>>::Fun

Source§

fn hmap(self, f: &Self::Fun) -> Vec<U>

Implementors§

Source§

impl<T, U> HMap<U> for T
where U: Call<T>,

Source§

type Fun = <U as Ho<Arg<T>>>::Fun