1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Define top-level RWS in terms of mapContiguous.

This commit is contained in:
Rob Rix 2017-10-23 20:43:22 -04:00
parent 72f6981f15
commit 40631d8d00

View File

@ -66,6 +66,10 @@ rws :: (Foldable syntax, Functor syntax, GAlign syntax)
rws _ _ as [] = This <$> as
rws _ _ [] bs = That <$> bs
rws canCompare _ [a] [b] = if canCompareTerms canCompare a b then [These a b] else [That b, This a]
rws canCompare equivalent as bs
= ses equivalent as bs
& mapContiguous canCompare
& fmap (bimap snd snd)
rws canCompare equivalent as bs
= ses equivalent as bs
& genFeaturizedTermsAndDiffs