diff --git a/lib/Data/Config/Suckless/Parse/Megaparsec.hs b/lib/Data/Config/Suckless/Parse/Megaparsec.hs index 6dff69b..6b947fe 100644 --- a/lib/Data/Config/Suckless/Parse/Megaparsec.hs +++ b/lib/Data/Config/Suckless/Parse/Megaparsec.hs @@ -27,7 +27,9 @@ data MegaParsec = MegaParsec deriving (Data,Typeable,Generic) -newtype instance Context MegaParsec = MegaContext (Maybe Int) +newtype instance Context MegaParsec = + MegaContext (Maybe Int) + deriving (Eq,Ord,Generic) instance IsContext MegaParsec where noContext = MegaContext Nothing diff --git a/lib/Data/Config/Suckless/Syntax.hs b/lib/Data/Config/Suckless/Syntax.hs index d9c7300..ba0f5e0 100644 --- a/lib/Data/Config/Suckless/Syntax.hs +++ b/lib/Data/Config/Suckless/Syntax.hs @@ -81,6 +81,10 @@ data Syntax c | Literal (Context c) Literal deriving stock (Generic) +deriving instance Eq (Context c) => Eq (Syntax c) +deriving instance Ord (Context c) => Ord (Syntax c) + + instance HasContext c (Syntax c) where setContext c1 = \case List _ v -> List c1 v