Lazy list implementation in Elm.
Analogous to List type. This is the actual implementation type for the
LazyList type. This type is exposed to the user if the user so wishes to
do pattern matching or understand how the list type works. It is not
recommended to work with this type directly. Try working solely with the
provided functions in the package.
Add a value to the front of a list.
Create an empty list.
Create a singleton list.
Detect if a list is empty or not.
Get the head of a list.
Get the tail of a list.
Test if a value is a member of a list.
Get the length of a lazy list.
Warning: This will not terminate if the list is infinite.
Convert a lazy list to a normal list.
Convert a normal list to a lazy list.
Convert a lazy list to an array.
Convert an array to a lazy list.
Map a function to a list.
Reduce a list with a given reducer and an initial value.
Example : reduce (+) 0 (1 ::: 2 ::: 3 ::: 4 ::: empty) == 10
Flatten a list of lists into a single list by appending all the inner lists into one big list.
Map then flatten.
Append a list to another list.
Analogous to List.foldl. Is an alias for reduce.
Analogous to List.foldr.
Places the given value between all members of the given list.
Interleave the elements of a list in another list. The two lists get interleaved at the end.
Reverse a list.
Take a list and repeat it ad infinitum. This cycles a finite list by putting the front after the end of the list. This results in a no-op in the case of an infinite list.
Create an infinite list of applications of a function on some value.
Equivalent to:
x ::: f x ::: f (f x) ::: f (f (f x)) ::: ... -- etc...Repeat a value ad infinitum.
Be careful when you use this. The result of this is a truly infinite list.
Do not try calling reduce or toList on an infinite list as it'll never
finish computing. Make sure you then filter it down to a finite list with head
or take or something.
Take at most n many values from a list.
Take elements from a list as long as the predicate is satisfied.
Drop at most n many values from a list.
Drop elements from a list as long as the predicate is satisfied.
Keep all elements in a list that satisfy the given predicate.
Drop all elements in a list that satisfy the given predicate.
Remove all duplicates from a list and return a list of distinct elements.
Known as mapN in some circles. Allows you to apply map in cases
where then number of arguments are greater than 5.
Chain list producing operations.
The list of counting numbers.
i.e.:
1 ::: 2 ::: 3 ::: 4 ::: 5 ::: ... -- etc...Get the sum of a list of numbers.
Get the product of a list of numbers.
Alias for cons. Analogous to :: for lists.
Alias for append. Analogous to ++ for lists.
Lazy List type.