theorem
Std.Iterators.IterM.DefaultConsumers.toArrayMapped_eq_match_step
{α β γ : Type w}
{m : Type w → Type w'}
{n : Type w → Type w''}
{lift : ⦃δ : Type w⦄ → m δ → n δ}
{f : β → n γ}
{it : IterM m β}
[Monad n]
[LawfulMonad n]
[Iterator α m β]
[Finite α m]
:
toArrayMapped lift f it = do
let __do_lift ← liftM it.step
match __do_lift with
| ⟨IterStep.yield it' out, property⟩ => do
let __do_lift ← f out
let __do_lift_1 ← toArrayMapped lift f it'
pure (#[__do_lift] ++ __do_lift_1)
| ⟨IterStep.skip it', property⟩ => toArrayMapped lift f it'
| ⟨IterStep.done, property⟩ => pure #[]
theorem
Std.Iterators.IterM.toArray_eq_match_step
{α β : Type w}
{m : Type w → Type w'}
{it : IterM m β}
[Monad m]
[LawfulMonad m]
[Iterator α m β]
[Finite α m]
[IteratorCollect α m m]
[LawfulIteratorCollect α m m]
:
theorem
Std.Iterators.IterM.toList_toArray
{α β : Type w}
{m : Type w → Type w'}
[Monad m]
[Iterator α m β]
[Finite α m]
[IteratorCollect α m m]
{it : IterM m β}
:
theorem
Std.Iterators.IterM.toArray_toList
{α β : Type w}
{m : Type w → Type w'}
[Monad m]
[LawfulMonad m]
[Iterator α m β]
[Finite α m]
[IteratorCollect α m m]
{it : IterM m β}
:
theorem
Std.Iterators.IterM.toList_eq_match_step
{α β : Type w}
{m : Type w → Type w'}
[Monad m]
[LawfulMonad m]
[Iterator α m β]
[Finite α m]
[IteratorCollect α m m]
[LawfulIteratorCollect α m m]
{it : IterM m β}
:
theorem
Std.Iterators.IterM.toListRev_eq_match_step
{α β : Type w}
{m : Type w → Type w'}
[Monad m]
[LawfulMonad m]
[Iterator α m β]
[Finite α m]
{it : IterM m β}
:
theorem
Std.Iterators.IterM.reverse_toListRev
{α β : Type w}
{m : Type w → Type w'}
[Monad m]
[LawfulMonad m]
[Iterator α m β]
[Finite α m]
[IteratorCollect α m m]
[LawfulIteratorCollect α m m]
{it : IterM m β}
:
theorem
Std.Iterators.IterM.toListRev_eq
{α β : Type w}
{m : Type w → Type w'}
[Monad m]
[LawfulMonad m]
[Iterator α m β]
[Finite α m]
[IteratorCollect α m m]
[LawfulIteratorCollect α m m]
{it : IterM m β}
:
theorem
Std.Iterators.LawfulIteratorCollect.toArray_eq
{α β : Type w}
{m : Type w → Type w'}
[Monad m]
[Iterator α m β]
[Finite α m]
[IteratorCollect α m m]
[hl : LawfulIteratorCollect α m m]
{it : IterM m β}
:
theorem
Std.Iterators.LawfulIteratorCollect.toList_eq
{α β : Type w}
{m : Type w → Type w'}
[Monad m]
[Iterator α m β]
[Finite α m]
[IteratorCollect α m m]
[hl : LawfulIteratorCollect α m m]
{it : IterM m β}
: