mirror of
https://github.com/github/semantic.git
synced 2024-12-26 16:33:03 +03:00
Fold strictly.
This commit is contained in:
parent
11859c9b51
commit
e15f5ad7ab
@ -206,7 +206,7 @@ insertion previous unmappedA unmappedB (UnmappedTerm j _ b) = do
|
||||
genFeaturizedTermsAndDiffs :: (Functor f, HasField fields (Maybe FeatureVector))
|
||||
=> RWSEditScript f fields
|
||||
-> ([UnmappedTerm f fields], [UnmappedTerm f fields], [MappedDiff f fields], [TermOrIndexOrNone (UnmappedTerm f fields)])
|
||||
genFeaturizedTermsAndDiffs = snd . foldl combine ((0, 0), ([], [], [], []))
|
||||
genFeaturizedTermsAndDiffs = snd . foldl' combine ((0, 0), ([], [], [], []))
|
||||
where combine ((counterA, counterB), (as, bs, mappedDiffs, allDiffs)) diff = case diff of
|
||||
This term -> ((succ counterA, counterB), (featurize counterA term : as, bs, mappedDiffs, None : allDiffs))
|
||||
That term -> ((counterA, succ counterB), (as, featurize counterB term : bs, mappedDiffs, Term (featurize counterB term) : allDiffs))
|
||||
|
Loading…
Reference in New Issue
Block a user