diff options
-rw-r--r-- | src/Data/BEncode/BDict.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Data/BEncode/BDict.hs b/src/Data/BEncode/BDict.hs index 925027b..8ef6d20 100644 --- a/src/Data/BEncode/BDict.hs +++ b/src/Data/BEncode/BDict.hs | |||
@@ -89,7 +89,11 @@ lookup x = go | |||
89 | {-# INLINE lookup #-} | 89 | {-# INLINE lookup #-} |
90 | 90 | ||
91 | union :: BDictMap a -> BDictMap a -> BDictMap a | 91 | union :: BDictMap a -> BDictMap a -> BDictMap a |
92 | union = undefined | 92 | union Nil xs = xs |
93 | union xs Nil = xs | ||
94 | union bd @ (Cons k v xs) bd' @ (Cons k' v' xs') | ||
95 | | k < k' = Cons k v (union xs bd') | ||
96 | | otherwise = Cons k' v' (union bd xs') | ||
93 | 97 | ||
94 | map :: (a -> b) -> BDictMap a -> BDictMap b | 98 | map :: (a -> b) -> BDictMap a -> BDictMap b |
95 | map f = go | 99 | map f = go |