This module provides the typeclass ToIterator, which is implemented by types that can be
converted into iterators.
@[inline]
def
Std.Iterators.ToIterator.iterM
{γ : Type u_1}
{m : Type u_2 → Type u_3}
{α β : Type u_2}
(x : γ)
[ToIterator γ m α β]
:
IterM m β
Converts x into a monadic iterator.
Instances For
@[inline]
def
Std.Iterators.ToIterator.iter
{γ : Type u_1}
{α β : Type u_2}
[ToIterator γ Id α β]
(x : γ)
:
Iter β
Converts x into a pure iterator.
Equations
Instances For
@[inline]
def
Std.Iterators.ToIterator.ofM
{γ : Type u_1}
{m : Type w → Type u_2}
{β : Type w}
(α : Type w)
(iterM : γ → IterM m β)
:
ToIterator γ m α β
Creates a monadic ToIterator instance.
Equations
- Std.Iterators.ToIterator.ofM α iterM = { iterMInternal := fun (x : γ) => iterM x }
Instances For
@[inline]
def
Std.Iterators.ToIterator.of
{γ : Type u_1}
{β : Type w}
(α : Type w)
(iter : γ → Iter β)
:
ToIterator γ Id α β
Creates a pure ToIterator instance.
Equations
- Std.Iterators.ToIterator.of α iter = { iterMInternal := fun (x : γ) => (iter x).toIterM }
Instances For
theorem
Std.Iterators.ToIterator.iterM_eq
{γ : Type u}
{α β : Type v}
{it : γ → IterM Id β}
{x : γ}
:
Replaces ToIterator.iterM with its definition.
theorem
Std.Iterators.ToIterator.iter_eq
{γ : Type u}
{x : γ}
{α β : Type v}
{it : γ → IterM Id β}
:
Replaces ToIterator.iter with its definition.