lean4-htt/tests/lean/run/takeSimpEqns.lean
Markus Himmel 5c707d936c
chore: rename Stream to Std.Stream (#10645)
This PR renames `Stream` to `Std.Stream` so that the name becomes
available to mathlib after a deprecation cycle.
2025-10-02 15:25:56 +00:00

8 lines
210 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@[simp] def take [S : Std.Stream ρ τ] (s : ρ) : Nat → List τ × ρ
| 0 => ([], s)
| n+1 =>
match S.next? s with
| none => ([], s)
| some (x,rest) =>
let (L,rest) := take rest n
(x::L, rest)