package feat-num
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module FeatNum.IFSeqSource
include FeatCore.IFSeqSig.IFSEQ_EXTENDED with type index = Num.t
include FeatCore.IFSeqSig.IFSEQ_BASIC with type index = Num.t
'a seq is the type of sequences whose elements have type 'a.
Constructors.
singleton x is a sequence of length one whose single element is x.
sum s1 s2 is the concatenation of the sequences s1 and s2.
product s1 s2 is the Cartesian product of the sequences s1 and s2. Its length is the product of the lengths of s1 and s2. The first pair component is considered most significant.
map phi s is the image of the sequence s through the function phi. If the user wishes to work with sequences of pairwise distinct elements, then phi should be injective. If furthermore the user wishes to work with sequences that enumerate all elements of a type, then phi should be surjective.
up i j is the sequence of the integers from i included up to j excluded.
The type index is the type of integers used to represent indices and lengths.
get s i is the i-th element of the sequence s. The index i must be comprised between zero included and length s excluded.
foreach s k iterates over all elements of the sequence s. Each element in turn is passed to the loop body k.
sample m s k is an explicit sequence of at most m elements extracted out of the implicit sequence s, prepended in front of the existing sequence k. If length s is at most m, then all elements of s are produced. Otherwise, a random sample of m elements extracted out of s is produced.