interface Hashable { fn hash(obj: Self) -> Int; } fn hash(n: Int) -> Int { return *n; // Identity hash } fn hash(n: Bool) -> Int { if n { return 1; } return 0; } implement Hashable for Int; implement Hashable for Bool;