From 2f5da43a32529a774d9da1fefca24f1af9f14573 Mon Sep 17 00:00:00 2001 From: Sean Haugh Date: Sat, 20 Apr 2024 16:38:32 -0500 Subject: [PATCH] feat: add default equivalence --- src/ask/equivalence.gleam | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ask/equivalence.gleam b/src/ask/equivalence.gleam index fdcf958..bea1be0 100644 --- a/src/ask/equivalence.gleam +++ b/src/ask/equivalence.gleam @@ -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`. ///