Skip to content

Commit b334d6a

Browse files
committed
Update documentation for two
1 parent 0c2ffcf commit b334d6a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Data/HashMap/Internal.hs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -949,14 +949,11 @@ unsafeInsert k0 v0 m0 = runST (go h0 k0 v0 0 m0)
949949
| otherwise = go h k x s $ BitmapIndexed (mask hy s) (A.singleton t)
950950
{-# INLINABLE unsafeInsert #-}
951951

952-
-- | Create a map from two key-value pairs which hashes don't collide. To
953-
-- enhance sharing, the second key-value pair is represented by the hash of its
954-
-- key and a singleton HashMap pairing its key with its value.
955-
--
956-
-- Note: to avoid silly thunks, this function must be strict in the
957-
-- key. See issue #232. We don't need to force the HashMap argument
958-
-- because it's already in WHNF (having just been matched) and we
959-
-- just put it directly in an array.
952+
-- | Create a map from a key-value pair and a 'Leaf' or 'Collision' node with
953+
-- a different hash.
954+
--
955+
-- It is the caller's responsibility to ensure that the 'HashMap' argument is
956+
-- in WHNF.
960957
two :: Shift -> Hash -> k -> v -> Hash -> HashMap k v -> ST s (HashMap k v)
961958
two = go
962959
where

0 commit comments

Comments
 (0)