mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
📝 compareCategoryEq.
This commit is contained in:
parent
3f919eec26
commit
b43494afda
@ -129,6 +129,7 @@ decorateTerm decorator = cata $ \ c -> cofree ((decorator (extract <$> c) .: hea
|
|||||||
termCostDecorator :: (Prologue.Foldable f, Functor f) => TermDecorator f a Cost
|
termCostDecorator :: (Prologue.Foldable f, Functor f) => TermDecorator f a Cost
|
||||||
termCostDecorator c = 1 + sum (cost <$> tailF c)
|
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 :: HasField fields Category => Term leaf (Record fields) -> Term leaf (Record fields) -> Bool
|
||||||
compareCategoryEq = (==) `on` category . extract
|
compareCategoryEq = (==) `on` category . extract
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user