[package]
[Java implementation]
[Execution output]
HashMap
import java.util.function.Function;
import church.lang.Array;
import church.util.Entry;
import church.util.HashTable;
import church.util.CollectionsSupport;
import church.util.LinkedList;
class HashMap<K, V>: hashMap1(HashTable<Entry<K, V>, K>: hashTable);map elements = hashMap1(HashTable.hashTable4(Entry: entry −> entry.key, ==, hashCode, elements));
empty_set = map([]);(HashMap: map).size = map.hashTable.size;(HashMap: map).get2(key, defaultFactory) = CollectionsSupport.get0(map.hashTable, key, defaultFactory);
(HashMap: map).get(key) = CollectionsSupport.getOrFail(map.hashTable, key);(HashMap: map).contains(key) = map.hashTable.contains(key);
leftFold = CollectionsSupport.leftLift (HashTable.leftFold, HashMap: m −> m.hashTable);
rightFold = CollectionsSupport.rightLift(HashTable.rightFold, HashMap: m −> m.hashTable);
outEntry(stream, entry(key, value)) = stream << key << " -> " << value;
stream << hashMap = CollectionsSupport.encode3(stream, leftFold, hashMap, outEntry);