Skip to content

Commit

Permalink
block style
Browse files Browse the repository at this point in the history
  • Loading branch information
yj-qin authored and bobzhang committed Nov 16, 2024
1 parent 7013fb8 commit f6f4836
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions immut/array/array.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions immut/priority_queue/priority_queue.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions immut/sorted_map/map.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f6f4836

Please sign in to comment.