# StreamAggregate SΒΆ

aggcat.spad line 1623 [edit on github]

S: Type

A stream aggregate is a linear aggregate which possibly has an infinite number of elements. A basic domain constructor which builds stream aggregates is Stream. From streams, a number of infinite structures such as power series can be built.

- #: % -> NonNegativeInteger if % has finiteAggregate
from Aggregate

- <=: (%, %) -> Boolean if S has OrderedSet and % has finiteAggregate
from PartialOrder

- <: (%, %) -> Boolean if S has OrderedSet and % has finiteAggregate
from PartialOrder

- =: (%, %) -> Boolean if S has SetCategory or % has finiteAggregate and S has BasicType or % has finiteAggregate and S has Hashable
from BasicType

- >=: (%, %) -> Boolean if S has OrderedSet and % has finiteAggregate
from PartialOrder

- >: (%, %) -> Boolean if S has OrderedSet and % has finiteAggregate
from PartialOrder

- ~=: (%, %) -> Boolean if S has SetCategory or % has finiteAggregate and S has BasicType or % has finiteAggregate and S has Hashable
from BasicType

- any?: (S -> Boolean, %) -> Boolean if % has finiteAggregate
from HomogeneousAggregate S

- child?: (%, %) -> Boolean if S has BasicType
from RecursiveAggregate S

- children: % -> List %
from RecursiveAggregate S

- coerce: % -> OutputForm if S has CoercibleTo OutputForm
from CoercibleTo OutputForm

- concat!: (%, %) -> % if % has shallowlyMutable
from UnaryRecursiveAggregate S

- concat!: (%, S) -> % if % has shallowlyMutable
from UnaryRecursiveAggregate S

- concat!: List % -> % if % has shallowlyMutable
from UnaryRecursiveAggregate S

- concat: (%, %) -> %
from LinearAggregate S

- concat: (%, S) -> %
from LinearAggregate S

- concat: (S, %) -> %
from LinearAggregate S

- concat: List % -> %
from LinearAggregate S

- construct: List S -> %
from Collection S

- convert: % -> InputForm if S has ConvertibleTo InputForm
from ConvertibleTo InputForm

- copyInto!: (%, %, Integer) -> % if % has shallowlyMutable and % has finiteAggregate
from LinearAggregate S

- count: (S -> Boolean, %) -> NonNegativeInteger if % has finiteAggregate
from HomogeneousAggregate S

- count: (S, %) -> NonNegativeInteger if % has finiteAggregate and S has BasicType
from HomogeneousAggregate S

- cycleEntry: % -> %
from UnaryRecursiveAggregate S

- cycleLength: % -> NonNegativeInteger
from UnaryRecursiveAggregate S

- cycleSplit!: % -> % if % has shallowlyMutable
from UnaryRecursiveAggregate S

- cycleTail: % -> %
from UnaryRecursiveAggregate S

- cyclic?: % -> Boolean
from RecursiveAggregate S

- delete: (%, Integer) -> %
from LinearAggregate S

- delete: (%, UniversalSegment Integer) -> %
from LinearAggregate S

- distance: (%, %) -> Integer
from RecursiveAggregate S

- elt: (%, first) -> S
from UnaryRecursiveAggregate S

- elt: (%, Integer) -> S
- elt: (%, Integer, S) -> S
from EltableAggregate(Integer, S)

- elt: (%, last) -> S
from UnaryRecursiveAggregate S

- elt: (%, rest) -> %
from UnaryRecursiveAggregate S

- elt: (%, UniversalSegment Integer) -> %
from Eltable(UniversalSegment Integer, %)

- elt: (%, value) -> S
from RecursiveAggregate S

- entries: % -> List S
from IndexedAggregate(Integer, S)

- entry?: (S, %) -> Boolean if % has finiteAggregate and S has BasicType
from IndexedAggregate(Integer, S)

- eval: (%, Equation S) -> % if S has SetCategory and S has Evalable S
from Evalable S

- eval: (%, List Equation S) -> % if S has SetCategory and S has Evalable S
from Evalable S

- eval: (%, List S, List S) -> % if S has SetCategory and S has Evalable S
from InnerEvalable(S, S)

- eval: (%, S, S) -> % if S has SetCategory and S has Evalable S
from InnerEvalable(S, S)

- every?: (S -> Boolean, %) -> Boolean if % has finiteAggregate
from HomogeneousAggregate S

- explicitlyFinite?: % -> Boolean
`explicitlyFinite?(s)`

tests if the stream has a finite number of elements, and`false`

otherwise. Note: for many datatypes,`explicitlyFinite?(s) = not possiblyInfinite?(s)`

.

- fill!: (%, S) -> % if % has shallowlyMutable
from IndexedAggregate(Integer, S)

- find: (S -> Boolean, %) -> Union(S, failed)
from Collection S

- first: % -> S
from IndexedAggregate(Integer, S)

- first: (%, NonNegativeInteger) -> %
from LinearAggregate S

- hash: % -> SingleInteger if % has finiteAggregate and S has Hashable
from Hashable

- hashUpdate!: (HashState, %) -> HashState if % has finiteAggregate and S has Hashable
from Hashable

- index?: (Integer, %) -> Boolean
from IndexedAggregate(Integer, S)

- indices: % -> List Integer
from IndexedAggregate(Integer, S)

- insert: (%, %, Integer) -> %
from LinearAggregate S

- insert: (S, %, Integer) -> %
from LinearAggregate S

- last: % -> S
from UnaryRecursiveAggregate S

- last: (%, NonNegativeInteger) -> %
from UnaryRecursiveAggregate S

- latex: % -> String if S has SetCategory
from SetCategory

- leaf?: % -> Boolean
from RecursiveAggregate S

- leaves: % -> List S
from RecursiveAggregate S

- leftTrim: (%, S) -> % if % has finiteAggregate and S has BasicType
from LinearAggregate S

- less?: (%, NonNegativeInteger) -> Boolean
from Aggregate

- map!: (S -> S, %) -> % if % has shallowlyMutable
from HomogeneousAggregate S

- map: ((S, S) -> S, %, %) -> %
from LinearAggregate S

- map: (S -> S, %) -> %
from HomogeneousAggregate S

- max: % -> S if S has OrderedSet and % has finiteAggregate
from HomogeneousAggregate S

- max: (%, %) -> % if S has OrderedSet and % has finiteAggregate
from OrderedSet

- max: ((S, S) -> Boolean, %) -> S if % has finiteAggregate
from HomogeneousAggregate S

- maxIndex: % -> Integer
from IndexedAggregate(Integer, S)

- member?: (S, %) -> Boolean if % has finiteAggregate and S has BasicType
from HomogeneousAggregate S

- members: % -> List S if % has finiteAggregate
from HomogeneousAggregate S

- merge: (%, %) -> % if S has OrderedSet and % has finiteAggregate
from LinearAggregate S

- merge: ((S, S) -> Boolean, %, %) -> % if % has finiteAggregate
from LinearAggregate S

- min: % -> S if S has OrderedSet and % has finiteAggregate
from HomogeneousAggregate S

- min: (%, %) -> % if S has OrderedSet and % has finiteAggregate
from OrderedSet

- minIndex: % -> Integer
from IndexedAggregate(Integer, S)

- more?: (%, NonNegativeInteger) -> Boolean
from Aggregate

- new: (NonNegativeInteger, S) -> %
from LinearAggregate S

- node?: (%, %) -> Boolean if S has BasicType
from RecursiveAggregate S

- nodes: % -> List %
from RecursiveAggregate S

- parts: % -> List S if % has finiteAggregate
from HomogeneousAggregate S

- position: (S -> Boolean, %) -> Integer if % has finiteAggregate
from LinearAggregate S

- position: (S, %) -> Integer if % has finiteAggregate and S has BasicType
from LinearAggregate S

- position: (S, %, Integer) -> Integer if % has finiteAggregate and S has BasicType
from LinearAggregate S

- possiblyInfinite?: % -> Boolean
`possiblyInfinite?(s)`

tests if the stream`s`

could possibly have an infinite number of elements. Note: for many datatypes,`possiblyInfinite?(s) = not explictlyFinite?(s)`

.

- qelt: (%, Integer) -> S
from EltableAggregate(Integer, S)

- qsetelt!: (%, Integer, S) -> S if % has shallowlyMutable
from EltableAggregate(Integer, S)

- qsetfirst!: (%, S) -> S if % has shallowlyMutable
from UnaryRecursiveAggregate S

- qsetrest!: (%, %) -> % if % has shallowlyMutable
from UnaryRecursiveAggregate S

- reduce: ((S, S) -> S, %) -> S if % has finiteAggregate
from Collection S

- reduce: ((S, S) -> S, %, S) -> S if % has finiteAggregate
from Collection S

- reduce: ((S, S) -> S, %, S, S) -> S if % has finiteAggregate and S has BasicType
from Collection S

- remove: (S -> Boolean, %) -> % if % has finiteAggregate
from Collection S

- remove: (S, %) -> % if % has finiteAggregate and S has BasicType
from Collection S

- removeDuplicates: % -> % if % has finiteAggregate and S has BasicType
from Collection S

- rest: % -> %
from UnaryRecursiveAggregate S

- rest: (%, NonNegativeInteger) -> %
from UnaryRecursiveAggregate S

- reverse!: % -> % if % has shallowlyMutable and % has finiteAggregate
from LinearAggregate S

- reverse: % -> % if % has finiteAggregate
from LinearAggregate S

- rightTrim: (%, S) -> % if % has finiteAggregate and S has BasicType
from LinearAggregate S

- second: % -> S
from UnaryRecursiveAggregate S

- select: (S -> Boolean, %) -> % if % has finiteAggregate
from Collection S

- setchildren!: (%, List %) -> % if % has shallowlyMutable
from RecursiveAggregate S

- setelt!: (%, first, S) -> S if % has shallowlyMutable
from UnaryRecursiveAggregate S

- setelt!: (%, Integer, S) -> S if % has shallowlyMutable
from EltableAggregate(Integer, S)

- setelt!: (%, last, S) -> S if % has shallowlyMutable
from UnaryRecursiveAggregate S

- setelt!: (%, rest, %) -> % if % has shallowlyMutable
from UnaryRecursiveAggregate S

- setelt!: (%, UniversalSegment Integer, S) -> S if % has shallowlyMutable
from LinearAggregate S

- setelt!: (%, value, S) -> S if % has shallowlyMutable
from RecursiveAggregate S

- setfirst!: (%, S) -> S if % has shallowlyMutable
from UnaryRecursiveAggregate S

- setlast!: (%, S) -> S if % has shallowlyMutable
from UnaryRecursiveAggregate S

- setrest!: (%, %) -> % if % has shallowlyMutable
from UnaryRecursiveAggregate S

- setvalue!: (%, S) -> S if % has shallowlyMutable
from RecursiveAggregate S

- size?: (%, NonNegativeInteger) -> Boolean
from Aggregate

- smaller?: (%, %) -> Boolean if S has OrderedSet and % has finiteAggregate or S has Comparable and % has finiteAggregate
from Comparable

- sort!: % -> % if % has shallowlyMutable and S has OrderedSet and % has finiteAggregate
from LinearAggregate S

- sort!: ((S, S) -> Boolean, %) -> % if % has shallowlyMutable and % has finiteAggregate
from LinearAggregate S

- sort: % -> % if S has OrderedSet and % has finiteAggregate
from LinearAggregate S

- sort: ((S, S) -> Boolean, %) -> % if % has finiteAggregate
from LinearAggregate S

- sorted?: % -> Boolean if S has OrderedSet and % has finiteAggregate
from LinearAggregate S

- sorted?: ((S, S) -> Boolean, %) -> Boolean if % has finiteAggregate
from LinearAggregate S

- split!: (%, NonNegativeInteger) -> % if % has shallowlyMutable
from UnaryRecursiveAggregate S

- swap!: (%, Integer, Integer) -> Void if % has shallowlyMutable
from IndexedAggregate(Integer, S)

- tail: % -> %
from UnaryRecursiveAggregate S

- third: % -> S
from UnaryRecursiveAggregate S

- trim: (%, S) -> % if % has finiteAggregate and S has BasicType
from LinearAggregate S

- value: % -> S
from RecursiveAggregate S

BasicType if S has SetCategory or % has finiteAggregate and S has BasicType or % has finiteAggregate and S has Hashable

CoercibleTo OutputForm if S has CoercibleTo OutputForm

Comparable if S has Comparable and % has finiteAggregate or S has OrderedSet and % has finiteAggregate

ConvertibleTo InputForm if S has ConvertibleTo InputForm

Eltable(UniversalSegment Integer, %)

Evalable S if S has SetCategory and S has Evalable S

Hashable if % has finiteAggregate and S has Hashable

InnerEvalable(S, S) if S has SetCategory and S has Evalable S

OrderedSet if S has OrderedSet and % has finiteAggregate

PartialOrder if S has OrderedSet and % has finiteAggregate

SetCategory if S has SetCategory