Given an instance of ScanVectorMachine V' (V S)
, we can produce
a type V''
and instance ScanVectorMachine V'' (V' (V S))
. In
other words, given an implementation of vectors with some nonzero
nesting depth, this will produce an implementation with nesting
depth one level deeper.
This is different from SegmentedVectors
, which uses flat
vectors (0-deep nesting) to emulate segmented vectors (1-deep
nesting) by cutting the size of the scalars in half. Here, there
is no need to assume that the flat-vector scalars are twice as
wide (in terms of bits) as the segmented scalars, so arbitrarily
deep nesting may be achieved without sacrificing any additional
bit-width. In addition, NestedVectors
introduces less overhead
than SegmentedVectors
. For this reason, many hardware/platform
providers choose to implement ScanVectorMachine V' (V S)
instead of ScanVectorMachine (V S)
; this requires more work
(more methods to implement), but eliminates the overhead of
SegmentedVectors
.