From 080ae940eba7a7ee31d4704f93e98d339c78b667 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Thu, 9 Jan 2025 10:56:23 -0800 Subject: [PATCH] Alter Direction Eq instance --- unison-runtime/src/Unison/Runtime/ANF.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/unison-runtime/src/Unison/Runtime/ANF.hs b/unison-runtime/src/Unison/Runtime/ANF.hs index ca52283326..ea801a5b50 100644 --- a/unison-runtime/src/Unison/Runtime/ANF.hs +++ b/unison-runtime/src/Unison/Runtime/ANF.hs @@ -1443,7 +1443,18 @@ type Cte v = CTE v (ANormal v) type Ctx v = Directed () [Cte v] data Direction a = Indirect a | Direct - deriving (Eq, Ord, Show, Functor, Foldable, Traversable) + deriving (Show, Functor, Foldable, Traversable) + +instance Eq (Direction a) where + Indirect _ == Indirect _ = True + Direct == Direct = True + _ == _ = False + +instance Ord (Direction a) where + compare (Indirect _) (Indirect _) = EQ + compare (Indirect _) Direct = LT + compare Direct (Indirect _) = GT + compare Direct Direct = EQ directed :: (Foldable f) => f (Cte v) -> Directed () (f (Cte v)) directed x = (foldMap f x, x)