Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 809ab74

Browse files
committed
UndecidableInstances instead of QuantifiedConstraints.
I'd rather do this than fuss with CI for old versions of the compiler.
1 parent 07a5740 commit 809ab74

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

semantic-analysis/src/Analysis/Syntax.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{-# LANGUAGE QuantifiedConstraints #-}
21
{-# LANGUAGE RankNTypes #-}
2+
{-# LANGUAGE UndecidableInstances #-}
33
module Analysis.Syntax
44
( -- * Syntax
55
Term(..)
@@ -18,19 +18,19 @@ data Term sig v
1818
= Var v
1919
| Term (sig (Term sig v))
2020

21-
instance (forall t . Eq t => Eq (sig t), Eq v) => Eq (Term sig v) where
21+
instance (Eq (sig (Term sig v)), Eq v) => Eq (Term sig v) where
2222
Var v1 == Var v2 = v1 == v2
2323
Term s1 == Term s2 = s1 == s2
2424
_ == _ = False
2525

26-
instance (forall t . Eq t => Eq (sig t), forall t. Ord t => Ord (sig t), Ord v) => Ord (Term sig v) where
26+
instance (Ord (sig (Term sig v)), Ord v) => Ord (Term sig v) where
2727
compare (Var v1) (Var v2) = compare v1 v2
2828
compare (Var _) _ = LT
2929
compare (Term s1) (Term s2) = compare s1 s2
3030
compare _ _ = GT
3131

3232

33-
subterms :: (forall t . Eq t => Eq (sig t), forall t . Ord t => Ord (sig t), Ord v, Foldable sig, Functor sig) => Term sig v -> Set.Set (Term sig v)
33+
subterms :: (Ord (sig (Term sig v)), Ord v, Foldable sig, Functor sig) => Term sig v -> Set.Set (Term sig v)
3434
subterms = paraTerm (Set.singleton . Var) (foldMap (uncurry Set.insert))
3535

3636
foldTerm :: Functor sig => (v -> r) -> (sig r -> r) -> (Term sig v -> r)

0 commit comments

Comments
 (0)