Eq, Ord instances for Syntax
This commit is contained in:
parent
b017bc1e9d
commit
3fbf491a78
|
@ -27,7 +27,9 @@ data MegaParsec =
|
||||||
MegaParsec
|
MegaParsec
|
||||||
deriving (Data,Typeable,Generic)
|
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
|
instance IsContext MegaParsec where
|
||||||
noContext = MegaContext Nothing
|
noContext = MegaContext Nothing
|
||||||
|
|
|
@ -81,6 +81,10 @@ data Syntax c
|
||||||
| Literal (Context c) Literal
|
| Literal (Context c) Literal
|
||||||
deriving stock (Generic)
|
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
|
instance HasContext c (Syntax c) where
|
||||||
setContext c1 = \case
|
setContext c1 = \case
|
||||||
List _ v -> List c1 v
|
List _ v -> List c1 v
|
||||||
|
|
Loading…
Reference in New Issue