summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF/TrieMap.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/haskell/PGF/TrieMap.hs')
-rw-r--r--src/runtime/haskell/PGF/TrieMap.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/haskell/PGF/TrieMap.hs b/src/runtime/haskell/PGF/TrieMap.hs
index f0383941a..fbf6ea26e 100644
--- a/src/runtime/haskell/PGF/TrieMap.hs
+++ b/src/runtime/haskell/PGF/TrieMap.hs
@@ -79,12 +79,12 @@ unionsWith f = foldl (unionWith f) empty
elems :: TrieMap k v -> [v]
elems tr = collect tr []
where
- collect (Tr mb_v m) xs = maybe id (:) mb_v (Map.fold collect xs m)
+ collect (Tr mb_v m) xs = maybe id (:) mb_v (Map.foldr collect xs m)
toList :: TrieMap k v -> [([k],v)]
toList tr = collect [] tr []
where
- collect ks (Tr mb_v m) xs = maybe id (\v -> (:) (ks,v)) mb_v (Map.foldWithKey (\k -> collect (k:ks)) xs m)
+ collect ks (Tr mb_v m) xs = maybe id (\v -> (:) (ks,v)) mb_v (Map.foldrWithKey (\k -> collect (k:ks)) xs m)
fromListWith :: Ord k => (v -> v -> v) -> [([k],v)] -> TrieMap k v
fromListWith f xs = foldl' (\trie (ks,v) -> insertWith f ks v trie) empty xs