Pudu programming language
Menu
API reference

Std.Iter.take

1 declaration

fn

take: Q -> Int -> Std.Iter.Taken[Q, T]

This is a callable function.

What it does

The first limit items, or all of them if there are fewer.

This is what makes an endless sequence usable: the source is never asked

for an item past the limit, so a walk of take(naturals(), 5) ends.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • Names inside [ ] are type arguments, such as the item type held by a collection.

Back to Std.IterSearch related declarations