From dfb16bf1dccc1afc8c503bf1d9d80d7df5ef6c87 Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Sat, 2 Nov 2024 13:43:17 -0400 Subject: [PATCH] Add equals# for Fin# --- src/Arithmetic/Fin.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Arithmetic/Fin.hs b/src/Arithmetic/Fin.hs index 447daeb..84e68dc 100644 --- a/src/Arithmetic/Fin.hs +++ b/src/Arithmetic/Fin.hs @@ -65,6 +65,9 @@ module Arithmetic.Fin , fromInt# , constant# + -- * Compare + , equals# + -- * Lift and Unlift , lift , unlift @@ -75,7 +78,7 @@ import Prelude hiding (last, succ) import Arithmetic.Nat (( Nat# a -> Fin# b constant# (Nat# i) = Fin# i + +equals# :: Fin# n -> Fin# n -> Bool +equals# (Fin# a) (Fin# b) = Exts.isTrue# (a ==# b)