1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Erase the feature vector from equal terms.

This commit is contained in:
Rob Rix 2017-02-07 16:11:51 -05:00
parent 3a0c0c29a6
commit 04cc05c20f

View File

@ -149,7 +149,7 @@ rws compare as bs
-- Possibly replace terms in a diff.
replaceIfEqual :: Term f (Record fields) -> Term f (Record fields) -> Maybe (Diff f (Record fields))
replaceIfEqual a b
| (category <$> a) == (category <$> b) = hylo wrap runCofree <$> zipTerms a b
| (category <$> a) == (category <$> b) = hylo wrap runCofree <$> zipTerms (eraseFeatureVector a) (eraseFeatureVector b)
| otherwise = Nothing
cost = iter (const 0) . (1 <$)