[package]
[Java implementation]
[Execution output]
HashSet
import java.util.function.Function;
import church.lang.Array;
import church.util.HashTable;
import church.util.CollectionsSupport;
import church.util.LinkedList;
class HashSet<T>: hashSet1(HashTable<T, T>: hashTable);set(elements) = hashSet1(HashTable.hashTable4(Function.identity(), ==, hashCode, elements));
empty_set = set([]);(HashSet: set).size = set.hashTable.size;(HashSet: set).contains(element) = set.hashTable.contains(element);leftFold = CollectionsSupport.leftLift (HashTable.leftFold, (HashSet: s) −> s.hashTable);
rightFold = CollectionsSupport.rightLift(HashTable.rightFold, (HashSet: s) −> s.hashTable);
stream << hashSet = CollectionsSupport.encode3(stream, leftFold, hashSet, <<);