Eq, Ord instances for Syntax
This commit is contained in:
parent
b017bc1e9d
commit
3fbf491a78
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue