This repository was archived by the owner on Oct 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ toUnfoldable = unfoldr go
378378 go :: Map k v -> Maybe (Tuple (Tuple k v ) (Map k v ))
379379 go Leaf = Nothing
380380 go (Two left k v right) = Just $ Tuple (Tuple k v) (left <> right)
381- go (Three left k1 v1 mid k2 v2 right) = Just $ Tuple (Tuple k1 v1) (Two left k2 v2 right)
381+ go (Three left k1 v1 mid k2 v2 right) = Just $ Tuple (Tuple k1 v1) (insert k2 v2 (left <> mid <> right) )
382382
383383-- | Get a list of the keys contained in a map
384384keys :: forall k v . Map k v -> List k
Original file line number Diff line number Diff line change @@ -202,6 +202,10 @@ mapTests = do
202202 quickCheck $ \(TestMap m) -> let f m' = M .fromFoldable (M .toList m') in
203203 M .toList (f m) == M .toList (m :: M.Map SmallKey Int ) <?> show m
204204
205+ log " fromFoldable . toUnfoldable = id"
206+ quickCheck $ \(TestMap m) -> let f m' = M .fromFoldable (M .toUnfoldable m' :: List (Tuple SmallKey Int )) in
207+ f m == (m :: M.Map SmallKey Int ) <?> show m
208+
205209 log " fromFoldableWith const = fromFoldable"
206210 quickCheck $ \arr -> M .fromFoldableWith const arr ==
207211 M .fromFoldable (arr :: List (Tuple SmallKey Int )) <?> show arr
You can’t perform that action at this time.
0 commit comments