Indexable
trait Indexable[t: Type]
SourceAn Indexable
instance on a type means that it has a (partial or total) mapping from indices
(Idx
) to elements (Elm
). The mapping can be accessed by get
.
If all indices might not be defined (e.g. only a range of integers is valid) then then Aef
should include an error like OutOfBounds
or KeyNotFound
.
Note that the set of defined indices can be infinite which does not naturally allow iteration. An integer map with a default element would always contain all integers indices. This implies that iteration would go through all integers.
Associated Types
type Aef: Eff
SourceThe effect of get
.
type Elm: Type
SourceThe return type of get
and the type of elements in the data structure.
type Idx: Type
SourceThe argument type of get
, used to access the elements of the data structure.