Skip to content

Commit

Permalink
use consistent naming for predicate function arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomocavalieri authored and lpil committed Oct 23, 2023
1 parent 8f2c807 commit 251838e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/gleam/map.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ fn do_values(map: Map(k, v)) -> List(v) {
///
pub fn filter(
in map: Map(k, v),
keeping property: fn(k, v) -> Bool,
keeping predicate: fn(k, v) -> Bool,
) -> Map(k, v) {
do_filter(property, map)
do_filter(predicate, map)
}

@target(erlang)
Expand Down
4 changes: 2 additions & 2 deletions src/gleam/set.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ pub fn fold(
///
pub fn filter(
in set: Set(member),
keeping property: fn(member) -> Bool,
keeping predicate: fn(member) -> Bool,
) -> Set(member) {
Set(map.filter(in: set.map, keeping: fn(m, _) { property(m) }))
Set(map.filter(in: set.map, keeping: fn(m, _) { predicate(m) }))
}

pub fn drop(from set: Set(member), drop disallowed: List(member)) -> Set(member) {
Expand Down

0 comments on commit 251838e

Please sign in to comment.