Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Usage

import * as fun from "https://raw.githubusercontent.com/baetheus/fun/main/iterable.ts";

This file contains the Iterable algebraic data type. Iterable is a lazy, synchronous, and native structure defined by ecmascript. Generally, one interacts with the Iterator structure directly, but the Iterable type, being more generic, is a better target for functional. Any data structure that implements Iterable (ie. Array, Map, Set, etc) can use the iterable methods contained here if neeeded.

Something to keep in mind here is that Iterables can have nasty edge cases that don't exist for non-lazy data structures. Specifically, an iterable can generate a theoretically infinite number of values, making the draining of an iterable potentially impossible (trying it will cause the runtime to hang). Additionally, many iterables are constructed using generators, which cannot be easily cloned. This makes the process of chaining iterables a resource intensive operation. As always, use these combinators with care.

§Variables

ApplicableIterable
bind
bindTo
FilterableIterable
FlatmappableIterable
FoldableIterable
MappableIterable
tap
WrappableIterable

§Functions

apply
clone
collect

Collect all values of an iterable into an array. WARNING: If the iterable is infinite then this will cause the program to hang indefinitely.

combine
filter
filterMap
flatmap
fold
forEach
getCombinable
getInitializable
getShowable
init
iterable
map
partition
partitionMap
range
repeat
scan
take
takeUntil
takeWhile
wrap

§Interfaces

KindIterable