This repository was archived by the owner on Oct 4, 2020. It is now read-only.
File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ toUnfoldable = unfoldr go
378
378
go :: Map k v -> Maybe (Tuple (Tuple k v ) (Map k v ))
379
379
go Leaf = Nothing
380
380
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) )
382
382
383
383
-- | Get a list of the keys contained in a map
384
384
keys :: forall k v . Map k v -> List k
Original file line number Diff line number Diff line change @@ -202,6 +202,10 @@ mapTests = do
202
202
quickCheck $ \(TestMap m) -> let f m' = M .fromFoldable (M .toList m') in
203
203
M .toList (f m) == M .toList (m :: M.Map SmallKey Int ) <?> show m
204
204
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
+
205
209
log " fromFoldableWith const = fromFoldable"
206
210
quickCheck $ \arr -> M .fromFoldableWith const arr ==
207
211
M .fromFoldable (arr :: List (Tuple SmallKey Int )) <?> show arr
You can’t perform that action at this time.
0 commit comments