tern.algorithm.mutation

Algorithms for mutating ranges and other various range functions.

Public Imports

tern.algorithm.lazy_filter
public import tern.algorithm.lazy_filter;
Undocumented in source.
tern.algorithm.lazy_map
public import tern.algorithm.lazy_map;
Undocumented in source.
tern.algorithm.lazy_substitute
public import tern.algorithm.lazy_substitute;
Undocumented in source.

Members

Enums

FILO
enum FILO

First In Last Out

LIFO
enum LIFO

Last In First Out

Functions

alienate
void alienate(T range, size_t index, size_t length)

Alienates i..length in range, removing it.

clear
void clear(T range)

Clears all elements in range without modifying length.

fill
void fill(A range, B elem)

Fills all elements in range with elem.

filter
LazyFilter!(F, T) filter(T range)

Filters range by predicate F, where values will removed if F is false.

insert
void insert(A range, size_t index, B elem)

Inserts elem in range at index.

join
A join(A[] ranges, B by)

Joins an array of ranges by an element by.

map
LazyMap!(F, T) map(T range)

Maps range to F, where every value will become the output of F.

peek
ElementType!T peek(T range)

Duplicates the top value of range without modifying the stack.

pop
ElementType!T pop(T range)

Pops a value off of range.

push
void push(A range, B val)

Pushes a value onto range.

remove
A remove(A range, B val)

Removes val from range.

removeMany
A removeMany(A range, B vals)

Removes many vals from range.

replace
A replace(A range, B from, C to)

Replaces all instances of from in range

replaceMany
A replaceMany(A range, B to, C from)

Replaces all values in from with to in range.

reverse
void reverse(T range)

Reverses the contents of range.

split
A[] split(A range, B by)

Splits range by a given element to split by.

split
A[] split(A range)

Splits range by a given predicate F.

substitute
LazySubstitute!(A, B, C) substitute(A range, B from, C to)

Substitutes all instances of from in range with to.

swap
void swap(T range, size_t i0, size_t i1)

Swaps elements i0 and i1 in range.

swap
void swap(T range)

Swaps the top two values on the stack.

Meta