1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

📝 compareCategoryEq.

This commit is contained in:
Rob Rix 2016-08-10 09:47:11 -04:00
parent 3f919eec26
commit b43494afda

View File

@ -129,6 +129,7 @@ decorateTerm decorator = cata $ \ c -> cofree ((decorator (extract <$> c) .: hea
termCostDecorator :: (Prologue.Foldable f, Functor f) => TermDecorator f a Cost
termCostDecorator c = 1 + sum (cost <$> tailF c)
-- | Determine whether two terms are comparable based on the equality of their categories.
compareCategoryEq :: HasField fields Category => Term leaf (Record fields) -> Term leaf (Record fields) -> Bool
compareCategoryEq = (==) `on` category . extract