# fromList

Convert a list of key/value pairs into a hash table. Equality on keys is taken from the Eq instance for the key type.
O(n*min(n,W)). 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")]
O(n*min(n,W)). Create a set from a list of integers.
O(n). 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.
O(n*log n). Create a set from a list of elements. If the elemens are ordered, linear-time implementation is used, with the performance equal to fromDistinctAscList.
O(n*log n). 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 of the list are ordered, linear-time implementation is used, with the performance equal to fromDistinctAscList. > 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")]
O(n*min(n,W)). Create a map from a list of key/value pairs with a combining function. See also fromAscListWith. > fromListWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"a")] == fromList [(3, "ab"), (5, "aba")] > fromListWith (++) [] == empty
O(n*min(n,W)). Create a map from a list of key/value pairs with a combining function. See also fromAscListWith. > fromListWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"c")] == fromList [(3, "ab"), (5, "cba")] > fromListWith (++) [] == empty
O(n*log n). Build a map from a list of key/value pairs with a combining function. See also fromAscListWith. > fromListWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"a")] == fromList [(3, "ab"), (5, "aba")] > fromListWith (++) [] == empty
O(n*min(n,W)). Build a map from a list of key/value pairs with a combining function. See also fromAscListWithKey'. > fromListWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"a")] == fromList [(3, "ab"), (5, "aba")] > fromListWith (++) [] == empty
O(n*min(n,W)). Build a map from a list of key/value pairs with a combining function. See also fromAscListWithKey'. > let f key new_value old_value = (show key) ++ ":" ++ new_value ++ "|" ++ old_value > fromListWithKey f [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"c")] == fromList [(3, "3:a|b"), (5, "5:c|5:b|a")] > fromListWithKey f [] == empty
O(n*log n). Build a map from a list of key/value pairs with a combining function. See also fromAscListWithKey. > let f k a1 a2 = (show k) ++ a1 ++ a2 > fromListWithKey f [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"a")] == fromList [(3, "3ab"), (5, "5a5ba")] > fromListWithKey f [] == empty