diff --git a/immut/array/array.mbt b/immut/array/array.mbt index 9375262a6..e9f8980cc 100644 --- a/immut/array/array.mbt +++ b/immut/array/array.mbt @@ -379,6 +379,7 @@ pub impl[X : @quickcheck.Arbitrary] @quickcheck.Arbitrary for T[X] with arbitrar @quickcheck.Arbitrary::arbitrary(size, rs) |> from_array } +///| pub impl[A : Hash] Hash for T[A] with hash_combine(self, hasher) { for e in self { hasher.combine(e) diff --git a/immut/priority_queue/priority_queue.mbt b/immut/priority_queue/priority_queue.mbt index 77ba320eb..31d44c806 100644 --- a/immut/priority_queue/priority_queue.mbt +++ b/immut/priority_queue/priority_queue.mbt @@ -234,10 +234,12 @@ pub fn to_string[A : Show + Compare](self : T[A]) -> String { Show::to_string(self) } +///| pub impl[A : Compare] Eq for T[A] with op_equal(self, other) { self.length() == other.length() && self.to_array() == other.to_array() } +///| pub impl[A : Hash + Compare] Hash for T[A] with hash_combine(self, hasher) { for e in self { hasher.combine(e) diff --git a/immut/sorted_map/map.mbt b/immut/sorted_map/map.mbt index 32e3ebc0f..83a4613e8 100644 --- a/immut/sorted_map/map.mbt +++ b/immut/sorted_map/map.mbt @@ -140,6 +140,7 @@ pub impl[K : @quickcheck.Arbitrary + Compare, V : @quickcheck.Arbitrary] @quickc @quickcheck.Arbitrary::arbitrary(size, rs) |> from_array } +///| pub impl[K : Hash, V : Hash] Hash for T[K, V] with hash_combine(self, hasher) { for e in self { hasher..combine(e.0).combine(e.1)