Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Data/HashMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ unsafeInsert :: forall k v. (Eq k, Hashable k) => k -> v -> HashMap k v -> HashM
unsafeInsert k0 v0 m0 = runST (go h0 k0 v0 0 m0)
where
h0 = hash k0
go :: forall s. Hash -> k -> v -> Int -> HashMap k v -> ST s (HashMap k v)
go :: forall s. Hash -> k -> v -> Shift -> HashMap k v -> ST s (HashMap k v)
go !h !k x !_ Empty = return $! Leaf h (L k x)
go h k x s t@(Leaf hy l@(L ky y))
| hy == h = if ky == k
Expand Down
22 changes: 11 additions & 11 deletions Data/HashMap/Internal/Strict.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE UnboxedTuples #-}
{-# OPTIONS_HADDOCK not-home #-}

------------------------------------------------------------------------
Expand Down Expand Up @@ -126,15 +126,15 @@ module Data.HashMap.Internal.Strict
) where

import Control.Applicative (Const (..))
import Control.Monad.ST (runST, ST)
import Control.Monad.ST (ST, runST)
import Data.Bits ((.&.), (.|.))
import Data.Coerce (coerce)
import Data.Functor.Identity (Identity (..))
-- See Note [Imports from Data.HashMap.Internal]
import Data.Hashable (Hashable)
import Data.HashMap.Internal (Hash, HashMap (..), Leaf (..), LookupRes (..),
fullBitmap, hash, index, mask, nextShift, ptrEq,
sparseIndex)
Shift, fullBitmap, hash, index, mask, nextShift,
ptrEq, sparseIndex)
import Prelude hiding (lookup, map)

-- See Note [Imports from Data.HashMap.Internal]
Expand Down Expand Up @@ -235,7 +235,7 @@ unsafeInsertWithKey :: forall k v. (Eq k, Hashable k) => (k -> v -> v -> v) -> k
unsafeInsertWithKey f k0 v0 m0 = runST (go h0 k0 v0 0 m0)
where
h0 = hash k0
go :: forall s. Hash -> k -> v -> Int -> HashMap k v -> ST s (HashMap k v)
go :: forall s. Hash -> k -> v -> Shift -> HashMap k v -> ST s (HashMap k v)
go !h !k x !_ Empty = return $! leaf h k x
go h k x s t@(Leaf hy l@(L ky y))
| hy == h = if ky == k
Expand Down