Trait adapton::adapton_sigs::Adapton [] [src]

pub trait Adapton: Debug + PartialEq + Eq + Hash + Clone {
    type Name: Debug + PartialEq + Eq + Hash + Clone;
    type Loc: Debug + PartialEq + Eq + Hash + Clone;
    fn new() -> Self;
    fn name_of_usize(self: &mut Self, usize) -> Self::Name;
    fn name_of_string(self: &mut Self, String) -> Self::Name;
    fn name_pair(self: &mut Self, Self::Name, Self::Name) -> Self::Name;
    fn name_fork(self: &mut Self, Self::Name) -> (Self::Name, Self::Name);
    fn ns<T, F>(self: &mut Self, Self::Name, body: F) -> T where F: FnOnce(&mut Self) -> T;
    fn cnt<Res, F>(self: &mut Self, body: F) -> (Res, Cnt) where F: FnOnce(&mut Self) -> Res;
    fn put<T: Eq + Debug + Clone>(self: &mut Self, T) -> Art<T, Self::Loc>;
    fn cell<T: Eq + Debug + Clone>(self: &mut Self, Self::Name, T) -> MutArt<T, Self::Loc>;
    fn set<T: Eq + Debug + Clone>(self: &mut Self, MutArt<T, Self::Loc>, T);
    fn thunk<Arg: Eq + Hash + Debug + Clone, Spurious: Clone, Res: Eq + Debug + Clone>(self: &mut Self, id: ArtIdChoice<Self::Name>, prog_pt: ProgPt, fn_box: Rc<Box<Fn(&mut Self, Arg, Spurious) -> Res>>, arg: Arg, spurious: Spurious) -> Art<Res, Self::Loc>;
    fn force<T: Eq + Debug + Clone>(self: &mut Self, &Art<T, Self::Loc>) -> T;

    fn name_fork3(self: &mut Self, n: Self::Name) -> (Self::Name, Self::Name, Self::Name) { ... }
    fn name_fork4(self: &mut Self, n: Self::Name) -> (Self::Name, Self::Name, Self::Name, Self::Name) { ... }
    fn read_only<T>(self: &mut Self, mutart: MutArt<T, Self::Loc>) -> Art<T, Self::Loc> { ... }
}

The Adapton trait provides a language of dependence-graph-building operations based on the core calculus described in "Incremental Computation with Names", 2015

Associated Types

type Name: Debug + PartialEq + Eq + Hash + Clone

type Loc: Debug + PartialEq + Eq + Hash + Clone

Required Methods

fn new() -> Self

fn name_of_usize(self: &mut Self, usize) -> Self::Name

fn name_of_string(self: &mut Self, String) -> Self::Name

fn name_pair(self: &mut Self, Self::Name, Self::Name) -> Self::Name

fn name_fork(self: &mut Self, Self::Name) -> (Self::Name, Self::Name)

fn ns<T, F>(self: &mut Self, Self::Name, body: F) -> T where F: FnOnce(&mut Self) -> T

Creates or re-enters a given namespace; performs the given computation there.

fn cnt<Res, F>(self: &mut Self, body: F) -> (Res, Cnt) where F: FnOnce(&mut Self) -> Res

fn put<T: Eq + Debug + Clone>(self: &mut Self, T) -> Art<T, Self::Loc>

Creates immutable, eager articulation.

fn cell<T: Eq + Debug + Clone>(self: &mut Self, Self::Name, T) -> MutArt<T, Self::Loc>

Creates a mutable articulation.

fn set<T: Eq + Debug + Clone>(self: &mut Self, MutArt<T, Self::Loc>, T)

Mutates a mutable articulation.

fn thunk<Arg: Eq + Hash + Debug + Clone, Spurious: Clone, Res: Eq + Debug + Clone>(self: &mut Self, id: ArtIdChoice<Self::Name>, prog_pt: ProgPt, fn_box: Rc<Box<Fn(&mut Self, Arg, Spurious) -> Res>>, arg: Arg, spurious: Spurious) -> Art<Res, Self::Loc>

Creates an articulated computation.

fn force<T: Eq + Debug + Clone>(self: &mut Self, &Art<T, Self::Loc>) -> T

Demand & observe arts (all kinds): force

Provided Methods

fn name_fork3(self: &mut Self, n: Self::Name) -> (Self::Name, Self::Name, Self::Name)

fn name_fork4(self: &mut Self, n: Self::Name) -> (Self::Name, Self::Name, Self::Name, Self::Name)

fn read_only<T>(self: &mut Self, mutart: MutArt<T, Self::Loc>) -> Art<T, Self::Loc>

Implementors