From a56c3aa47d78764ecd6eadfa249c5fc8b0a83346 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 24 Dec 2014 22:29:04 +0100 Subject: custom instance Eq SearchResult --- Notmuch/SearchResult.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Notmuch') diff --git a/Notmuch/SearchResult.hs b/Notmuch/SearchResult.hs index 164c5b3..3dbf6bc 100644 --- a/Notmuch/SearchResult.hs +++ b/Notmuch/SearchResult.hs @@ -25,7 +25,13 @@ data SearchResult = SearchResult { , searchMatched :: Int , searchTotal :: Int } - deriving (Show,Eq) + deriving (Show) + + +instance Eq SearchResult where + s1 == s2 = + searchThread s1 == searchThread s2 + instance FromJSON SearchResult where parseJSON (Object v) = SearchResult <$> v .: "thread" -- cgit v1.2.3