DelayList
enum DelayList[a: Type]Sourcecase ENilcase ECons(a, DelayList[a])case LCons(a, Lazy[DelayList[a]])case LList(Lazy[DelayList[a]])Instances
instance Applicative[DelayList]Sourceinstance Filterable[DelayList]Sourceinstance Traversable[DelayList]Sourceinstance UnorderedFoldable[DelayList]Sourceinstance Witherable[DelayList]SourceDefinitions
@Experimental @LazyWhenPure Apply every function from f to every argument from l and return a list with all results.
For f = f1, f2, ... and l = x1, x2, ... the results appear in the order
f1(x1), f1(x2), ..., f2(x1), f2(x2), ....
Whether the i-th function in f (fi) is applied eagerly or lazily depends on its purity:
- If
fiis pure then it is applied lazily (i.e. the tail oflis not forced). - If
fiis impure then it is applied eagerly (i.e. the entire listlis forced).
Note that this implies that ALL functions in f must be pure to avoid forcing l.
@Experimental @Lazy Returns l2 appended to l1.
Does not force the tail of l1.
@Experimental Returns the number of elements in l that satisfy the predicate f.
Forces the entire list l.
@Experimental @Lazy Returns l without the first n elements.
Returns ENil if n > length(l).
Returns l if n < 1.
Does not force the tail of l.
@Experimental @LazyWhenPure Returns l without the longest prefix that satisfies the predicate f.
Whether f is applied eagerly or lazily depends on its purity:
- If
fis pure then it is applied lazily (i.e. the tail is not forced). - If
fis impure then it is applied eagerly (i.e. the tail is forced until the first element that satisfiesf).
@Experimental Returns true if and only if at least one element in l satisfies the predicate f.
Returns false if l is empty.
Forces elements of l until the predicate f is satisfied.
@Experimental @LazyWhenPure Returns a DelayList with every element in l that satisfies the predicate f.
Whether f is applied eagerly or lazily depends on its purity:
- If
fis pure then it is applied lazily (i.e. the tail is not forced). - If
fis impure then it is applied eagerly (i.e. the entire listlis forced).
@Experimental @LazyWhenPure Collects the results of applying the partial function f to every element in l.
Whether f is applied eagerly or lazily depends on its purity:
- If
fis pure then it is applied lazily (i.e. the tail is not forced). - If
fis impure then it is applied eagerly (i.e. the entire listlis forced).
@Experimental Optionally returns the first element of l that satisfies the predicate f when searching from left to right.
Forces elements of l until the predicate f is satisfied.
@Experimental Returns the first non-None result of applying the partial function f to each element of l.
Returns None if every element f(x) of l is None.
Forces elements of l until f(x) returns Some(v).
@Experimental Optionally returns the first element of l that satisfies the predicate f when searching from right to left.
Forces the entire list l.
@Experimental @LazyWhenPure Returns the result of applying f to every element in l and concatenating the results.
Whether f is applied eagerly or lazily depends on its purity:
- If
fis pure then it is applied lazily (i.e. the tail is not forced). - If
fis impure then it is applied eagerly (i.e. the entire listlis forced).
@Experimental @Lazy Returns the concatenation of the elements in l.
Does not force the tail of l.
@Experimental Applies f to a start value s and all elements in l going from left to right.
That is, the result is of the form: f(...f(f(s, x1), x2)..., xn).
Forces the entire list l.
Returns the result of mapping each element and combining the results.
@Experimental Applies f to a start value s and all elements in l going from right to left.
That is, the result is of the form: f(x1, ...f(xn-1, f(xn, s))...).
Forces the entire list l.
@Experimental Returns true if and only if all elements in l satisfy the predicate f.
Returns true if l is empty.
Forces elements in l until the first element that does not satisfy the predicate f (inclusive).
@Experimental Applies f to every element of l.
Forces the entire list l.
@Experimental Applies f to every element of l along with that element's index.
Forces the entire list l.
@Experimental Returns Some(x) if x is the first element of l.
Returns None if l is empty.
Does not force the tail of l.
@Experimental Returns Some(xs) where xs is l without the last element.
Returns None if l is empty.
Forces the entire list l.
@Experimental @Lazy Returns the concatenation of the elements in l2 with the elements
of l1 inserted between every two adjacent elements of l2.
That is, returns l2.1 :: l1.1 ... l1.n :: l2.2 :: ... :: l2.n-1 :: l1.1 :: ... :: l1.n :: l2.n :: ENil.
Does not force the tail of l2.
@Experimental @Lazy Returns l with x inserted between every two adjacent elements.
Does not force the tail of l.
@Experimental Returns true if and only if l is the empty DelayList, i.e. ENil.
Does not force the tail of l.
@Experimental @Lazy Returns l as an Iterator.
Does not force any elements of the list.
@Experimental Returns the concatenation of the string representation
of each element in l with sep inserted between each element.
Forces the entire list l.
@Experimental Returns the concatenation of the string representation
of each element in l according to f with sep inserted between each element.
Forces the entire list l.
@Experimental Returns Some(x) if x is the last element of l.
Returns None if l is empty.
Forces the entire list l.
@Experimental Returns the number of elements in l.
Forces the entire list l.
@Experimental @LazyWhenPure Returns the result of applying f to every element in l.
Whether f is applied eagerly or lazily depends on its purity:
- If
fis pure then it is applied lazily (i.e. the tail is not forced). - If
fis impure then it is applied eagerly (i.e. the entire listlis forced).
@Experimental @LazyWhenPure Returns the result of applying f to every element in l along with that element's index.
That is, the result is of the form: f(0, x0) :: f(1, x1) :: ....
Whether f is applied eagerly or lazily depends on its purity:
- If
fis pure then it is applied lazily (i.e. the tail is not forced). - If
fis impure then it is applied eagerly (i.e. the entire listlis forced).
@Experimental Optionally finds the largest element of l according to the Order on a.
Returns None if l is empty.
Forces the entire list l.
@Experimental Optionally finds the largest element of l according to the given comparator cmp.
Returns None if l is empty.
Forces the entire list l.
@Experimental Returns true if and only if l contains the element x.
Forces elements until x is found.
@Experimental Optionally finds the smallest element of l according to the Order on a.
Returns None if l is empty.
Forces the entire list l.
@Experimental Optionally finds the smallest element of l according to the given comparator cmp.
Returns None if l is empty.
Forces the entire list l.
@Experimental Returns true if and only if l is a non-empty DelayList.
Does not force the tail of l.
@Experimental Returns a pair of lists (l1, l2) where:
l1contains all elements oflthat satisfy the predicatef.l2contains all elements oflthat DO NOT satisfy the predicatef.
Forces the entire list l.
@Experimental @Lazy Returns a DelayList of all integers between b (inclusive) and e (exclusive).
Returns an empty DelayList if b >= e.
@Experimental Applies f to all elements in l going from left to right until a single value v is obtained. Returns Some(v).
That is, the result is of the form: Some(f(...f(f(x1, x2), x3)..., xn))
Returns None if l is empty.
Forces the entire list l.
@Experimental Applies f to all elements in l going from right to left until a single value v is obtained. Returns Some(v).
That is, the result is of the form: Some(f(x1, ...f(xn-2, f(xn-1, xn))...))
Returns None if l is empty.
Forces the entire list l.
@Experimental @Lazy Returns an infinite DelayList of repeating xs.
@Experimental @Lazy Returns l with every occurrence of src replaced by dst.
Does not force the tail of l.
@Experimental @Lazy Reverses the list l.
Does not force the tail of l.
@Experimental def sequence(l: DelayList[m[a]]): m[DelayList[a]] with Applicative[m]§ SourceReturns the result of running all the actions in the DelayList l.
Shuffles l using the Fisher–Yates shuffle.
@Experimental Returns the number of elements in l.
Forces the entire list l.
@Experimental @LazyWhenPure Returns a pair of lists (l1, l2) where:
l1is the longest prefix oflthat satisfies the predicatef.l2is the remainder ofl.
Whether f is applied eagerly or lazily depends on its purity:
- If
fis pure then it is applied lazily (i.e. the tail is not forced). - If
fis impure then it is applied eagerly (i.e. the entire listlis forced).
@Experimental @Lazy Returns an infinite sequence of integers starting from and including n.
@Experimental Returns the sum of all elements in the DelayList l.
Forces the entire list l.
@Experimental Returns the sum of all elements in the DelayList l according to the function f.
Forces the entire list l.
@Experimental Returns Some(xs) where xs is l without the first element.
Returns None if l is empty.
Forces l until the first element is found, but does not force the tail.
@Experimental @Lazy Returns the first n elements of l.
Does not force the tail of l.
@Experimental @LazyWhenPure Returns the longest prefix of l that satisfies the predicate f.
Whether f is applied eagerly or lazily depends on its purity:
- If
fis pure then it is applied lazily (i.e. the tail is not forced). - If
fis impure then it is applied eagerly (i.e. the tail is forced until the first element that satisfiesf).
@Experimental Returns l as an Array.
Forces the entire list l.
@Experimental Returns l as a List.
Forces the entire list l.
@Experimental Returns the association list l as a map.
If l contains multiple mappings with the same key, toMap does not
make any guarantees about which mapping will be in the resulting map.
Forces the entire list l.
@Experimental Returns l as a Set.
Forces the entire list l.
@Experimental Returns a string representation of l.
Forces the entire list l.
@Experimental Returns l as a Vector.
Forces the entire list l.
@Experimental def traverse(f: a -> m[b] \ ef, l: DelayList[a]): m[DelayList[b]] \ ef with Applicative[m]§ SourceReturns the result of applying the applicative mapping function f to all the elements of the
DelayList l.
@Experimental @Lazy Returns a list where the element at index i is (a, b) where
a is the element at index i in l1 and b is the element at index i in l2.
If either l1 or l2 is depleted, then no further elements are added to the resulting list.
Does not force the tail of either l1 or l2.
@Experimental @LazyWhenPure Returns a list where the element at index i is f(a, b) where
a is the element at index i in l1 and b is the element at index i in l2.
If either l1 or l2 is depleted, then no further elements are added to the resulting list.
Whether f is applied eagerly or lazily depends on its purity:
- If
fis pure then it is applied lazily (i.e. the tails are not forced). - If
fis impure then it is applied eagerly (i.e. both listsl1andl2are forced).