Zafu/Collection/Chainsource code:
public dependencies: Zafu/Abstract/Eq, Zafu/Abstract/Foldable,
Zafu/Abstract/Hash, Zafu/Abstract/Ord, Zafu/Abstract/Semigroup,
Zafu/Abstract/Traverse
Chainany, append, combine_all, concat, concat_all, empty, eq_Chain, exists, filter, flat_map, foldable_Chain, foldl, foldr, for_all, from_List, get, get_or, hash_Chain, is_empty, map, ord_Chain, prepend, singleton, size, to_List, traverse_Chain, uncons_left, uncons_rightChain[a]Internal tree used to support O(1) concat while preserving order. Invariant: WrapArray and WrapList only hold collections with at least two items.
type Chain[a: +*]
anydef any(chain: Chain[Bool]) -> Bool
appendAdd an item to the end of a chain.
references: Chain
def append[a](chain: Chain[a], item: a) -> Chain[a]
combine_allreferences: Chain, Option, Zafu/Abstract/Semigroup::Semigroup
def combine_all[a](chain: Chain[a], semi: Zafu/Abstract/Semigroup::Semigroup[a]) -> Option[a]
concatO(1) concatenation of two chains.
references: Chain
def concat[a](left: Chain[a], right: Chain[a]) -> Chain[a]
concat_allConcatenate all chains from left to right.
def concat_all[a](chains: List[Chain[a]]) -> Chain[a]
emptyEmpty chain.
references: Chain
empty: forall a: *. Chain[a]
eq_Chainreferences: Chain, Zafu/Abstract/Eq::Eq
def eq_Chain[a](eq_item: Zafu/Abstract/Eq::Eq[a]) -> Zafu/Abstract/Eq::Eq[Chain[a]]
existsdef exists[a](chain: Chain[a], pred: a -> Bool) -> Bool
filterKeep only elements satisfying pred.
def filter[a](chain: Chain[a], pred: a -> Bool) -> Chain[a]
flat_mapMap each element to a chain and concatenate.
references: Chain
def flat_map[a, b](chain: Chain[a], fn: a -> Chain[b]) -> Chain[b]
foldable_Chainreferences: Chain, Zafu/Abstract/Foldable::Foldable
foldable_Chain: Zafu/Abstract/Foldable::Foldable[Chain]
foldlStack-safe left fold.
references: Chain
def foldl[a, b](chain: Chain[a], init: b, fn: (b, a) -> b) -> b
foldrStack-safe right fold.
references: Chain
def foldr[a, b](chain: Chain[a], init: b, fn: (a, b) -> b) -> b
for_alldef for_all[a](chain: Chain[a], pred: a -> Bool) -> Bool
from_ListBuild a chain from a list.
def from_List[a](list: List[a]) -> Chain[a]
getOption-returning lookup.
references: Chain, Int, Option
def get[a](chain: Chain[a], idx: Int) -> Option[a]
get_orIndex lookup with fallback thunk.
def get_or[a](chain: Chain[a], idx: Int, fn: () -> a) -> a
hash_Chainreferences: Chain, Zafu/Abstract/Hash::Hash
def hash_Chain[a](hash_item: Zafu/Abstract/Hash::Hash[a]) -> Zafu/Abstract/Hash::Hash[Chain[a]]
is_emptydef is_empty[a](chain: Chain[a]) -> Bool
mapMap over all elements.
references: Chain
def map[a, b](chain: Chain[a], fn: a -> b) -> Chain[b]
ord_Chainreferences: Chain, Zafu/Abstract/Ord::Ord
def ord_Chain[a](ord_item: Zafu/Abstract/Ord::Ord[a]) -> Zafu/Abstract/Ord::Ord[Chain[a]]
prependAdd an item to the front of a chain.
references: Chain
def prepend[a](item: a, chain: Chain[a]) -> Chain[a]
singletonSingle-item chain.
references: Chain
def singleton[a](item: a) -> Chain[a]
sizeNumber of elements in the chain.
def size[a](chain: Chain[a]) -> Int
to_ListConvert to a list in iteration order.
def to_List[a](chain: Chain[a]) -> List[a]
traverse_Chainreferences: Chain, Zafu/Abstract/Traverse::Traverse
traverse_Chain: Zafu/Abstract/Traverse::Traverse[Chain]
uncons_leftreferences: Chain, Option, Tuple2
def uncons_left[a](chain: Chain[a]) -> Option[(a, Chain[a])]
uncons_rightreferences: Chain, Option, Tuple2
def uncons_right[a](chain: Chain[a]) -> Option[(Chain[a], a)]