mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
📝 termCost.
This commit is contained in:
parent
4447807bf6
commit
163f94b87e
@ -114,6 +114,7 @@ diffFiles parser renderer sourceBlobs = do
|
||||
Pure patch -> uncurry both (fromThese 0 0 (unPatch (cost . extract <$> patch)))
|
||||
shouldCompareTerms = (==) `on` category . extract
|
||||
|
||||
-- | Compute the cost of an unpacked term.
|
||||
termCost :: (Prologue.Foldable f, Functor f) => CofreeF f (Record a) (Record (Cost ': a)) -> Cost
|
||||
termCost c = 1 + sum (cost <$> tailF c)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user