1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! A collection of incremental data structures with dynamic input
//! and output.
//!
//! Many of the structures have an exposed mutable head for fast
//! updates, and an `archive` function to move the current head
//! past a pointer, defining subsequences. This pointer is
//! mutable, so that the changes can propagate to later
//! computations.
//!
//! Fold and Map type computations over a level tree or a raz tree
//! will be memoized, such that rerunning the computation after a
//! change will be much faster than running from scratch.
//!
//! These collections are partially mutable and partially
//! persistent (shared data). However, the authors have
//! concentrated on incremental features, so partial sharing is not
//! well implemented. Data archived without names will be fully
//! persistent so that changes to cloned data will not affect the
//! original. Data archived with names should be treated as a mutable
//! structure, with changes to cloned data affecting the original. These
//! affects will probably not be consistent. Editing a mutable structure
//! within a namespace (`adapton::engine::ns`) should produce a version
//! whose edits do not affect the original, but this has not been
//! thoroughly tested.
extern crate rand;
extern crate adapton;
// old work, but want to reincorporate the Level trait into current Raz
// Conversion function traits
// Cons-list
// Sequences with subsequence vectors and metadata
// generic tree with cannonical structure, basis for incremental functions
// interface for traversing a level tree
// Gauged Incremental Random Access Zipper
// Generic interface and concrete versions of metadata for searching the Raz
// Two forms of tries. They work, but performance needs improvement
/// Gauged Incremental Raz with element counts
pub type IRaz<E> = Raz;
pub type Giraz<E> = Raz;
/// Unfocused `IRaz`
pub type IRazTree<E> = RazTree;
pub type GirazTree<E> = RazTree;
/// Cross between vector and persistent stack
pub type ArchiveStack<E> = AStack;
///level generator for incremental structures