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

Use the fmap operator.

This commit is contained in:
Rob Rix 2017-10-23 15:50:06 -04:00
parent 226ba36c60
commit 76863d9e52

View File

@ -221,7 +221,7 @@ nearestUnmapped' :: (Foldable syntax, Functor syntax, GAlign syntax)
-> UnmappedTerm syntax ann2 -- ^ The term to find the nearest neighbour to.
-> Maybe (UnmappedTerm syntax ann1) -- ^ The most similar unmapped term, if any.
nearestUnmapped' isEligible tree key = listToMaybe (sortOn approximateEditDistance candidates)
where candidates = filter isEligible (fmap snd (kNearest tree defaultL (feature key)))
where candidates = filter isEligible (snd <$> kNearest tree defaultL (feature key))
approximateEditDistance = editDistanceUpTo defaultM (term key) . term
defaultD, defaultL, defaultP, defaultQ, defaultMoveBound :: Int