From 45a9392bd8c583b7f5c2d8e68c28ad8b32458de2 Mon Sep 17 00:00:00 2001 From: Joshua Chia Date: Tue, 27 Feb 2018 11:37:39 +0800 Subject: [PATCH] Use Eq instance of Map.Map --- src/Bookkeeper/Internal.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Bookkeeper/Internal.hs b/src/Bookkeeper/Internal.hs index f5ef8cb..d1741c3 100644 --- a/src/Bookkeeper/Internal.hs +++ b/src/Bookkeeper/Internal.hs @@ -43,11 +43,8 @@ instance ( ShowHelper (Book' xs) ) => ShowHelper (Book' ((k :=> v) ': xs)) where showHelper (Book (Map.Ext k v rest)) = (show k, show v):showHelper (Book rest) -instance Eq (Book' '[]) where - _ == _ = True - -instance (Eq val, Eq (Book' xs)) => Eq (Book' ((field :=> val) ': xs) ) where - Book (Map.Ext _ a as) == Book (Map.Ext _ b bs) = a == b && Book as == Book bs +instance Eq (Map.Map xs) => Eq (Book' xs) where + Book x == Book y = x == y instance Monoid (Book' '[]) where mempty = emptyBook