A bunch of utilities for working with iterables, many inspired by the native array methods.
MIT License
Published by scarf005 11 months ago
Published by scarf005 12 months ago
Published by scarf005 12 months ago
Published by scarf005 12 months ago
Many equivalents to Kotlin standard library were added 🎉
iter.average()
(inspired by Kotlin's sequences.average
)iter.takeWhile()
(inspired by Kotlin's sequences.takeWhile
)iter.drop()
(inspired by Kotlin's sequences.drop
)iter.dropUntil()
(like iter.until()
but drops til given predicate is true)iter.dropWhile()
(inspired by Kotlin's sequences.takeWhile
)iter.sum()
and iter.product()
.deno.json
again using the new [global-exclude][global-exclude]Published by jajaperson over 1 year ago
iter.flatMap()
🎉 (like Array.prototype.flatMap
)deno.json
Published by jajaperson about 2 years ago
copb
compatibilityiter.remember()
(originallyiter.rememeber()
)Published by jajaperson about 2 years ago
iter.peekable()
inspired by Rust's std::iter::Peekable
.create.range()
.Published by jajaperson about 2 years ago
iter.create.fromChars()
and iter.create.fromCharCodes()
for iterating over UTF-16 character units and codes respectively.Published by jajaperson about 2 years ago
Published by jajaperson about 2 years ago
Published by jajaperson about 2 years ago
iter.flat()
(like Array.prototype.flat
)iter.completeFlat()
for flattening an iterable completely.iter.fuse()
for ignoring values after and including the return.iter.create.fromResults()
for creating iterators directly from resultsPublished by jajaperson over 3 years ago
iter.forEach()
(like Array.prototype.forEach
)iter.lazyObserver()
for observing each yielded value lazily.iter.create.range()
for creating an iterable over a range of numbers.iter.sum()
for getting the sum of an iterable.iter.product()
for getting the product of an iterable.iter.norm()
for getting the vector norm of an iterable.Published by jajaperson over 3 years ago
iter
functions.
IterFunction
UniaryIterFunction
CurriedIterFunction
UniaryIterTransformer
Published by jajaperson over 3 years ago
IterableCircular
type for iterables using generator functions.fp.ts
. This is alsocurried
from the main mod.ts
.Iterable
now returns theIterableCircular
type. This doesn't break anything because these types arePublished by jajaperson over 3 years ago
LICENSE
from version.ts
and mod.ts
iter.remember()
so that an iterable can be iterated over multiple times andPublished by jajaperson over 3 years ago
IterableIterator
type now returns theIterable
type. This also means that returned iterables are not use-once.Published by jajaperson almost 4 years ago
Maybe it was too soon.
iter.find()
(like Array.prototype.find
)iter.findIndex()
(like Array.prototype.findIndex
)iter.includes()
(like Array.prototype.includes
)iter.filter()
(like Array.prototype.filter
)iter.until()
to cut off an iterable when a predicate returns trueiter.indexedPairs
(like Array.prototype.entries
)Published by jajaperson almost 4 years ago
iter.reduce()
(like Array.prototype.reduce
)iter.some()
(like Array.prototype.some
)iter.every()
(like Array.prototype.every
)iter.create.increments()
to create an endless incremementing interator.iter.create.from()
is now iter.create.endlessFrom()
.iter.create.from()
now creates an iterator from a function returningPublished by jajaperson almost 4 years ago
iter.pair()
fixed so it doesn't just give the same value.Published by jajaperson almost 4 years ago
iter.create.from()
for creating iterators from functions.iter.create.constant()
for creating an endless iterable of the same value.iter.create.randomNumbers()
for creating an endless iterable ofiter.map()
(like Array.prototype.map
)iter.take()
for taking the first n items of an iterable.iter.pair()
for zipping two iterables.iter.concat
(like Array.prototype.concat
)