InfiniteTuple(S)

ituple.spad line 1 [edit on github]

This package implements 'infinite tuples' for the interpreter. The representation is a stream.

coerce : % -> OutputForm
from CoercibleTo(OutputForm)
construct : % -> Stream(S)

construct(t) converts an infinite tuple to a stream.

filterUntil : (Mapping(Boolean, S), %) -> %

filterUntil(p, t) returns [x for x in t while not p(x)].

filterWhile : (Mapping(Boolean, S), %) -> %

filterWhile(p, t) returns [x for x in t while p(x)].

map : (Mapping(S, S), %) -> %

map(f, t) replaces the tuple t by [f(x) for x in t].

select : (Mapping(Boolean, S), %) -> %

select(p, t) returns [x for x in t | p(x)].

stream : (Mapping(S, S), S) -> %

stream(f, s) returns [s, f(s), f(f(s)), ...].

CoercibleTo(OutputForm)