@[inline]
def List.scanlM {m : Type u_1 → Type u_2} {β : Type u_1} {α : Type u_3} [Monad m] (f : β → α → m β) (init : β) (l : List α) :
m (List β)
Folds a monadic function over a list from the left, accumulating partial results starting with
init. The accumulated values are combined with the each element of the list in order, using f.
Instances For
@[inline]
def List.scanrM {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] (f : α → β → m β) (init : β) (xs : List α) :
m (List β)
Folds a monadic function over a list from the right, accumulating partial results starting with
init. The accumulated values are combined with the each element of the list in order, using f.