A type with an iterator typeclass and an inhabitant bundled together. This represents an arbitrarily typed iterator. It only exists for the construction of the equivalence relation on iterators.
This type is not meant to be used in executable code. Unbundled Iter
or IterM
iterators of a
specific type have better library support and are more efficient.
Instances For
Equations
- Std.Iterators.BundledIterM.ofIterM it = { α := α, inst := inferInstance, iterator := it }
Instances For
Equations
- Std.Iterators.instIteratorα bit = bit.inst
A noncomputable variant of IterM.step
using the HetT
monad.
It is used in the definition of the equivalence relations on iterators,
namely IterM.Equiv
and Iter.Equiv
.
Equations
- it.stepAsHetT = { Property := it.IsPlausibleStep, small := ⋯, operation := (fun (step : Subtype it.IsPlausibleStep) => Std.Internal.USquash.deflate step) <$> it.step }
Instances For
Equations
Instances For
Equivalence relation on bundled iterators.
Two bundled iterators are equivalent if they have the same Iterator.IsPlausibleStep
relation
and their step functions are the same up to equivalence of the successor iterators. This
coinductive definition captures the idea that the only relevant feature of an iterator is its step
function. Other information retrievable from the iterator -- for example, whether it is a list
iterator or an array iterator -- is totally irrelevant for the equivalence judgement.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Like BundledIterM.step
, but takes and returns iterators modulo BundledIterM.Equiv
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equivalence relation on monadic iterators. Equivalent iterators behave the same as long as the internal state of them is not directly inspected.
Two iterators (possibly of different types) are equivalent if they have the same
Iterator.IsPlausibleStep
relation and their step functions are the same up to equivalence of the
successor iterators. This coinductive definition captures the idea that the only relevant feature
of an iterator is its step function. Other information retrievable from the iterator -- for example,
whether it is a list iterator or an array iterator -- is totally irrelevant for the equivalence
judgement.
Equations
- ita.Equiv itb = Std.Iterators.BundledIterM.Equiv m β (Std.Iterators.BundledIterM.ofIterM ita) (Std.Iterators.BundledIterM.ofIterM itb)
Instances For
Equivalence relation on iterators. Equivalent iterators behave the same as long as the internal state of them is not directly inspected.
Two iterators (possibly of different types) are equivalent if they have the same
Iterator.IsPlausibleStep
relation and their step functions are the same up to equivalence of the
successor iterators. This coinductive definition captures the idea that the only relevant feature
of an iterator is its step function. Other information retrievable from the iterator -- for example,
whether it is a list iterator or an array iterator -- is totally irrelevant for the equivalence
judgement.