Skip to content

Commit

Permalink
remove unused bound
Browse files Browse the repository at this point in the history
  • Loading branch information
bobzhang committed Mar 19, 2024
1 parent 414a74a commit 5ce2a72
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions map/map.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub fn lookup[K : Compare, V](self : Map[K, V], key : K) -> Option[V] {
}

/// Iterate over the key-value pairs in the map.
pub fn iter[K : Compare, V](self : Map[K, V], f : (K, V) -> Unit) -> Unit {
pub fn iter[K, V](self : Map[K, V], f : (K, V) -> Unit) -> Unit {
match self {
Empty => ()
Tree(k, v, _, l, r) => {
Expand Down Expand Up @@ -196,18 +196,15 @@ pub fn iteri[K, V](self : Map[K, V], f : (Int, K, V) -> Unit) -> Unit {
}

/// Maps over the values in the map.
pub fn map[K , X, Y](self : Map[K, X], f : (X) -> Y) -> Map[K, Y] {
pub fn map[K, X, Y](self : Map[K, X], f : (X) -> Y) -> Map[K, Y] {
match self {
Empty => Empty
Tree(k, v, s, l, r) => Tree(k, f(v), s, map(l, f), map(r, f))
}
}

/// Maps over the key-value pairs in the map.
pub fn map_with_key[K , X, Y](
self : Map[K, X],
f : (K, X) -> Y
) -> Map[K, Y] {
pub fn map_with_key[K, X, Y](self : Map[K, X], f : (K, X) -> Y) -> Map[K, Y] {
match self {
Empty => Empty
Tree(k, v, s, l, r) =>
Expand Down

0 comments on commit 5ce2a72

Please sign in to comment.