1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Define Scope-compatible Eq & Ord instances for Term.

This commit is contained in:
Rob Rix 2019-07-17 11:10:24 -04:00
parent 8ca7382ab9
commit 9d7b63c56e
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -10,6 +10,18 @@ data Term sig a
= Var a
| Term (sig (Term sig) a)
deriving instance ( Eq a
, RightModule sig
, forall g x . (Eq x, Monad g, forall y . Eq y => Eq (g y)) => Eq (sig g x)
)
=> Eq (Term sig a)
deriving instance ( Ord a
, RightModule sig
, forall g x . (Eq x, Monad g, forall y . Eq y => Eq (g y)) => Eq (sig g x)
, forall g x . (Ord x, Monad g, forall y . Eq y => Eq (g y)
, forall y . Ord y => Ord (g y)) => Ord (sig g x)
)
=> Ord (Term sig a)
deriving instance (Show a, forall g x . (Show x, forall y . Show y => Show (g y)) => Show (sig g x)) => Show (Term sig a)
deriving instance ( forall g . Foldable g => Foldable (sig g)) => Foldable (Term sig)