ULiftT.{v, u} shrinks a monad on Type max u v to a monad on Type u.
Equations
- Std.Iterators.ULiftT n α = n (ULift α)
Instances For
instance
Std.Iterators.instLawfulMonadULiftT
{n : Type (max u v) → Type v'}
[Monad n]
[LawfulMonad n]
:
LawfulMonad (ULiftT n)
@[inline]
def
Std.Iterators.Types.ULiftIterator.Monadic.modifyStep
{α : Type u}
{m : Type u → Type u'}
{n : Type (max u v) → Type v'}
{β : Type u}
{lift : ⦃γ : Type u⦄ → m γ → ULiftT n γ}
(step : IterStep (IterM m β) β)
:
Transforms a step of the base iterator into a step of the uLift iterator.
Equations
- Std.Iterators.Types.ULiftIterator.Monadic.modifyStep (Std.IterStep.yield it' out) = Std.IterStep.yield { internalState := { inner := it' } } { down := out }
- Std.Iterators.Types.ULiftIterator.Monadic.modifyStep (Std.IterStep.skip it') = Std.IterStep.skip { internalState := { inner := it' } }
- Std.Iterators.Types.ULiftIterator.Monadic.modifyStep Std.IterStep.done = Std.IterStep.done
Instances For
instance
Std.Iterators.Types.ULiftIterator.instIterator
{α : Type u}
{m : Type u → Type u'}
{n : Type (max u v) → Type v'}
{β : Type u}
{lift : ⦃γ : Type u⦄ → m γ → ULiftT n γ}
[Iterator α m β]
[Monad n]
:
Iterator (ULiftIterator α m n β lift) n (ULift β)
Equations
- One or more equations did not get rendered due to their size.
instance
Std.Iterators.Types.ULiftIterator.instProductive
{α : Type u}
{m : Type u → Type u'}
{n : Type (max u v) → Type v'}
{β : Type u}
{lift : ⦃γ : Type u⦄ → m γ → ULiftT n γ}
[Iterator α m β]
[Productive α m]
[Monad n]
:
Productive (ULiftIterator α m n β lift) n
@[inline]
def
Std.IterM.uLift
{α β : Type u}
{m : Type u → Type u'}
(it : IterM m β)
(n : Type (max u v) → Type v')
[lift : MonadLiftT m (Iterators.ULiftT n)]
:
Transforms an m-monadic iterator with values in β into an n-monadic iterator with
values in ULift β. Requires a MonadLift m (ULiftT n) instance.
Marble diagram:
it ---a ----b ---c --d ---⊥
it.uLift n ---.up a----.up b---.up c--.up d---⊥
Termination properties:
Finite: only if the original iterator is finiteProductive: only if the original iterator is productive