From 3002074dd61e66456bed0f8be9b70fc060865dc1 Mon Sep 17 00:00:00 2001 From: ako Date: Wed, 8 Jul 2015 16:22:02 +0200 Subject: [PATCH] update equality instance of TPDB.Data.RS --- src/TPDB/Data.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/TPDB/Data.hs b/src/TPDB/Data.hs index 13e5f77..0a92356 100644 --- a/src/TPDB/Data.hs +++ b/src/TPDB/Data.hs @@ -17,6 +17,8 @@ import Control.Monad ( guard ) import Data.Hashable import Data.Function (on) +import qualified Data.Set as S + data Identifier = Identifier { _identifier_hash :: ! Int , name :: ! String @@ -66,8 +68,8 @@ data RS s r = } deriving ( Typeable ) -instance Eq r => Eq (RS s r) where - (==) = (==) `on` rules +instance Ord r => Eq (RS s r) where + (==) = (==) `on` (S.toList . S.fromList . rules) strict_rules sys = do u <- rules sys ; guard $ strict u ; return ( lhs u, rhs u )