1 import "JavaBuiltin" as Java
5 importJava "java.util.Map" where
8 containsKey :: T a b -> a -> Boolean
9 containsValue :: T a b -> b -> Boolean
10 size :: T a b -> Integer
11 isEmpty :: T a b -> Boolean
12 entrySet :: T a b -> Set.T (MMap.Entry a b)
13 get :: T a b -> a -> Maybe b
15 unsafeGet :: T a b -> a -> b
17 keySet :: T a b -> Set.T a
20 iter :: (a -> b -> <e> ()) -> T a b -> <e> ()
21 iter f m = Set.iter (\entry -> f (MMap.keyOf entry) (MMap.valueOf entry)) (entrySet m)
24 iterB :: (a -> b -> <e> Boolean) -> T a b -> <e> Boolean
25 iterB f m = Set.iterB (\entry -> f (MMap.keyOf entry) (MMap.valueOf entry)) (entrySet m)
28 fold :: (a -> b -> c -> <e> a) -> a -> T b c -> <e> a
29 fold f init m = Set.fold (\cur entry -> f cur (MMap.keyOf entry) (MMap.valueOf entry)) init (entrySet m)
32 freeze :: MMap.T a b -> <Proc> T a b
33 freeze = Java.unsafeCoerce
37 map :: (b -> <e> c) -> T a b -> <e> T a c
39 result = MMap.createC (size m)
40 iter (\k v -> put result k (f v)) m