fromList

Converts a normal list to a NonEmpty stream. Raises an error if given an empty list.
The fromList function constructs the structure l from the given list of Item l
Create a map from a list of key/value pairs.
fromList [] == empty
fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")]
fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]
Create a set from a list of integers.
Build a map from a list of key/value pairs. See also fromAscList. If the list contains more than one value for the same key, the last value for the key is retained. If the keys are in non-decreasing order, this function takes <math> time.
fromList [] == empty
fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")]
fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]
Create a sequence from a finite list of elements. There is a function toList in the opposite direction for all instances of the Foldable class, including Seq.
Create a set from a list of elements. If the elements are in non-decreasing order, this function takes <math> time.
Construct a map with the supplied mappings. If the list contains duplicate mappings, the later mappings take precedence.
>>> fromList [("a", 'x'), ("a", 'y')]
fromList [("a",'y')]
O(n) Convert a list to a vector. During the operation, the vector’s capacity will be doubling until the list's contents are in the vector. Depending on the list’s size, up to half of the vector’s capacity might be empty. If you’d rather avoid this, you can use fromListN, which will provide the exact space the list requires but will prevent list fusion, or force . fromList, which will create the vector and then copy it without the superfluous space.
Create a Bundle from a list
Convert a list to a Bundle
O(n) Convert a list to a vector. During the operation, the vector’s capacity will be doubling until the list's contents are in the vector. Depending on the list’s size, up to half of the vector’s capacity might be empty. If you’d rather avoid this, you can use fromListN, which will provide the exact space the list requires but will prevent list fusion, or force . fromList, which will create the vector and then copy it without the superfluous space.
O(n) Convert a list to a vector. During the operation, the vector’s capacity will be doubling until the list's contents are in the vector. Depending on the list’s size, up to half of the vector’s capacity might be empty. If you’d rather avoid this, you can use fromListN, which will provide the exact space the list requires but will prevent list fusion, or force . fromList, which will create the vector and then copy it without the superfluous space.
O(n) Convert a list to a vector. During the operation, the vector’s capacity will be doubling until the list's contents are in the vector. Depending on the list’s size, up to half of the vector’s capacity might be empty. If you’d rather avoid this, you can use fromListN, which will provide the exact space the list requires but will prevent list fusion, or force . fromList, which will create the vector and then copy it without the superfluous space.
O(n) Convert a list to a vector. During the operation, the vector’s capacity will be doubling until the list's contents are in the vector. Depending on the list’s size, up to half of the vector’s capacity might be empty. If you’d rather avoid this, you can use fromListN, which will provide the exact space the list requires but will prevent list fusion, or force . fromList, which will create the vector and then copy it without the superfluous space.
Construct a map with the supplied mappings. If the list contains duplicate mappings, the later mappings take precedence.
Construct a set from a list of elements.
O(n) amortized. Construct a Deque from a list of values.
>>> fromList [1,2]
BD 1 [1] 1 [2]
Build an index out of a bunch of packages. If there are duplicates by UnitId then later ones mask earlier ones.
Store the list in a flattened memory representation, avoiding the memory overhead of a linked list. The size n needs to be smaller or equal to the length of the list. If it is smaller than the length of the list, overflowing elements are discarded. It is undefined behaviour to set n to be bigger than the length of the list.
Turn a list into a Stream, by yielding each element in turn.
Create a map from a list of key/value pairs.
fromList [] == empty
fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")]
fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]