1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Pull the feature vector setter out.

This commit is contained in:
Rob Rix 2017-02-07 14:29:44 -05:00
parent b72e5fa730
commit 3814fb6968

View File

@ -170,7 +170,10 @@ rws compare as bs
eraseFeatureVector :: Term f (Record fields) -> Term f (Record fields)
eraseFeatureVector term = let record :< functor = runCofree term in
cofree (setField record (Nothing :: Maybe FeatureVector) :< functor)
cofree (setFeatureVector record Nothing :< functor)
setFeatureVector :: Record fields -> Maybe FeatureVector -> Record fields
setFeatureVector = setField
toMap = IntMap.fromList . fmap (termIndex &&& identity)