Skip to content

Commit

Permalink
feat: add default equivalence
Browse files Browse the repository at this point in the history
  • Loading branch information
furrycatherder committed Apr 20, 2024
1 parent 279464d commit 2f5da43
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ask/equivalence.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ pub fn trivial() -> Equivalence(a) {
fn(_, _) -> Bool { True }
}

/// Create a new equivalence that uses the default equality comparison.
///
pub fn default() -> Equivalence(a) {
fn(value: a, other: a) -> Bool { value == other }
}

/// Combine two equivalences into a new equivalence that returns `True` if both
/// equivalences return `True`.
///
Expand Down

0 comments on commit 2f5da43

Please sign in to comment.