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 @@ -559,7 +559,7 @@ instance (Hashable k, Hashable v) => Hashable (HashMap k v) where
hashWithSalt salt hm = go salt hm
where
go :: Int -> HashMap k v -> Int
go s Empty = s
go !s Empty = s
go s (BitmapIndexed _ a) = A.foldl' go s a
go s (Leaf h (L _ v))
= s `H.hashWithSalt` h `H.hashWithSalt` v
Expand Down
6 changes: 3 additions & 3 deletions Data/HashMap/Internal/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,13 @@ unsafeUpdateM ary idx b =
{-# INLINE unsafeUpdateM #-}

foldl' :: (b -> a -> b) -> b -> Array a -> b
foldl' f = \ z0 ary0 -> go ary0 (length ary0) 0 z0
foldl' f = \ z0 ary0 -> foldl'_ ary0 (length ary0) 0 z0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still hate all these convention-breaking name changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Sorry about that. I encountered that convention with the trailing _ in bytestring and hoped you'd be able to tolerate it a bit better. :|

where
go ary n i !z
foldl'_ !ary n i !z
| i >= n = z
| otherwise
= case index# ary i of
(# x #) -> go ary n (i+1) (f z x)
(# x #) -> foldl'_ ary n (i+1) (f z x)
{-# INLINE foldl' #-}

foldr' :: (a -> b -> b) -> b -> Array a -> b
Expand Down