fromList

fromList :: Eq key => (key -> Int32) -> [(key, val)] -> IO (HashTable key val)
base Data.HashTable
Convert a list of key/value pairs into a hash table. Equality on keys is taken from the Eq instance for the key type.
fromList :: [(Key, a)] -> IntMap a
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
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")]
fromList :: [Key] -> IntSet
containers Data.IntSet
O(n*min(n,W)). Create a set from a list of integers.
fromList :: [a] -> Seq a
containers Data.Sequence
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.
fromList :: Ord a => [a] -> Set a
containers Data.Set
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.
fromList :: Ord k => [(k, a)] -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
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")]
fromListWith :: (a -> a -> a) -> [(Key, a)] -> IntMap a
containers Data.IntMap.Strict
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
fromListWith :: (a -> a -> a) -> [(Key, a)] -> IntMap a
containers Data.IntMap.Lazy
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
fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
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
fromListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> IntMap a
containers Data.IntMap.Strict
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
fromListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> IntMap a
containers Data.IntMap.Lazy
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
fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k a
containers Data.Map.Lazy, containers Data.Map.Strict
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
toHtmlFromList :: HTML a => [a] -> Html
html Text.Html, xhtml Text.XHtml.Strict, xhtml Text.XHtml.Frameset, xhtml Text.XHtml.Transitional