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

Commit fcaf130

Browse files
committed
Replace FreeVariables with a function abstracted over a Foldable instance.
1 parent 40557a9 commit fcaf130

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

semantic-core/src/Analysis/Typecheck.hs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,8 @@ substAll :: Substitutable t => Substitution -> t -> t
192192
substAll s a = foldl' (flip subst) a (map (uncurry (:=)) (IntMap.toList s))
193193

194194

195-
class FreeVariables t where
196-
mvs :: t -> IntSet.IntSet
197-
198-
instance FreeVariables (Term Monotype Meta) where
199-
mvs = foldMap IntSet.singleton
200-
201-
instance FreeVariables Constraint where
202-
mvs (t1 :===: t2) = mvs t1 <> mvs t2
195+
mvs :: Foldable t => t Meta -> IntSet.IntSet
196+
mvs = foldMap IntSet.singleton
203197

204198
class Substitutable t where
205199
subst :: Solution -> t -> t

0 commit comments

Comments
 (0)