Documentation

Init.Data.Stream

class ToStream (collection : Type u) (stream : outParam (Type u)) :
Type u
  • toStream : collectionstream
Instances
class Stream (stream : Type u) (value : outParam (Type v)) :
Type (max u v)
  • next? : streamOption (value × stream)
Instances
def Stream.forIn {ρ : Type u_1} {α : Type u_2} {m : Type u_3Type u_4} {β : Type u_3} [inst : Stream ρ α] [inst : Monad m] (s : ρ) (b : β) (f : αβm (ForInStep β)) :
m β
Equations
partial def Stream.forIn.visit {ρ : Type u_1} {α : Type u_2} {m : Type u_3Type u_4} {β : Type u_3} [inst : Stream ρ α] [inst : Monad m] (f : αβm (ForInStep β)) (s : ρ) (b : β) :
m β
instance instForIn {ρ : Type u_1} {α : Type u_2} {m : Type u_3Type u_4} [inst : Stream ρ α] :
ForIn m ρ α
Equations
  • instForIn = { forIn := fun {β} [Monad m] => Stream.forIn }
instance instToStreamList {α : Type u_1} :
ToStream (List α) (List α)
Equations
  • instToStreamList = { toStream := fun c => c }
instance instToStreamArraySubarray {α : Type u_1} :
Equations
instance instToStreamSubarray {α : Type u_1} :
Equations
  • instToStreamSubarray = { toStream := fun a => a }
Equations
instance instStreamProdProd {ρ : Type u_1} {α : Type u_2} {γ : Type u_3} {β : Type u_4} [inst : Stream ρ α] [inst : Stream γ β] :
Stream (ρ × γ) (α × β)
Equations
  • One or more equations did not get rendered due to their size.
instance instStreamList {α : Type u_1} :
Stream (List α) α
Equations
  • instStreamList = { next? := fun x => match x with | [] => none | a :: as => some (a, as) }
instance instStreamSubarray {α : Type u_1} :
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • instStreamRangeNat = { next? := fun r => if r.start < r.stop then some (r.start, { start := r.start + r.step, stop := r.stop, step := r.step }) else none }
Equations
  • One or more equations did not get rendered due to their size.