From d41e12a8032b2993d80862f416f7a2ab5f7e22cc Mon Sep 17 00:00:00 2001 From: Marten Wijnja Date: Mon, 24 Feb 2025 20:03:19 +0100 Subject: [PATCH] Fixes docs of Data.HashMap.Lazy.fromList: it takes O(n * log(n)) --- Data/HashMap/Internal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/HashMap/Internal.hs b/Data/HashMap/Internal.hs index 2bb7029c..8c086107 100644 --- a/Data/HashMap/Internal.hs +++ b/Data/HashMap/Internal.hs @@ -2229,7 +2229,7 @@ toList :: HashMap k v -> [(k, v)] toList t = Exts.build (\ c z -> foldrWithKey (curry c) z t) {-# INLINE toList #-} --- | \(O(n)\) Construct a map with the supplied mappings. If the list +-- | \(O(n \log n)\) Construct a map with the supplied mappings. If the list -- contains duplicate mappings, the later mappings take precedence. fromList :: (Eq k, Hashable k) => [(k, v)] -> HashMap k v fromList = List.foldl' (\ m (k, v) -> unsafeInsert k v m) empty