Documentation

Std.Data.Iterators.Lemmas.Combinators.Monadic.TakeWhile

theorem Std.Iterators.IterM.step_takeWhileWithPostcondition {α : Type u_1} {m : Type u_1 → Type u_2} {β : Type u_1} [Monad m] [Iterator α m β] {it : IterM m β} {P : βPostconditionT m (ULift Bool)} :
(takeWhileWithPostcondition P it).step = do let __do_liftit.step match __do_lift with | IterStep.yield it' out, h => do let __do_lift(P out).operation match __do_lift with | { down := true }, h' => pure (PlausibleIterStep.yield (takeWhileWithPostcondition P it') out ) | { down := false }, h' => pure (PlausibleIterStep.done ) | IterStep.skip it', h => pure (PlausibleIterStep.skip (takeWhileWithPostcondition P it') ) | IterStep.done, h => pure (PlausibleIterStep.done )
theorem Std.Iterators.IterM.step_takeWhileM {α : Type u_1} {m : Type u_1 → Type u_2} {β : Type u_1} [Monad m] [LawfulMonad m] [Iterator α m β] {it : IterM m β} {P : βm (ULift Bool)} :
(takeWhileM P it).step = do let __do_liftit.step match __do_lift with | IterStep.yield it' out, h => do let __do_liftP out match __do_lift with | { down := true } => pure (PlausibleIterStep.yield (takeWhileM P it') out ) | { down := false } => pure (PlausibleIterStep.done ) | IterStep.skip it', h => pure (PlausibleIterStep.skip (takeWhileM P it') ) | IterStep.done, h => pure (PlausibleIterStep.done )
theorem Std.Iterators.IterM.step_takeWhile {α : Type u_1} {m : Type u_1 → Type u_2} {β : Type u_1} [Monad m] [LawfulMonad m] [Iterator α m β] {it : IterM m β} {P : βBool} :
(takeWhile P it).step = do let __do_liftit.step match __do_lift with | IterStep.yield it' out, h => match P out with | true => pure (PlausibleIterStep.yield (takeWhile P it') out ) | false => pure (PlausibleIterStep.done ) | IterStep.skip it', h => pure (PlausibleIterStep.skip (takeWhile P it') ) | IterStep.done, h => pure (PlausibleIterStep.done )