From f3c02a0efac50981e90ee06d0f8c2adc56b677ea Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 13 Jun 2017 15:13:57 -0400 Subject: [PATCH] Short-circuit the single comparable elements case. --- src/RWS.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/RWS.hs b/src/RWS.hs index 288e4384f..e17e49548 100644 --- a/src/RWS.hs +++ b/src/RWS.hs @@ -59,6 +59,7 @@ rws :: (HasField fields (Maybe FeatureVector), Functor f, Eq1 f) -> RWSEditScript f fields rws _ _ as [] = This <$> as rws _ _ [] bs = That <$> bs +rws _ canCompare [a] [b] | canCompareTerms canCompare a b = [These a b] rws editDistance canCompare as bs = Eff.run . RWS.run editDistance canCompare as bs $ do sesDiffs <- ses' (featureAs, featureBs, mappedDiffs, allDiffs) <- genFeaturizedTermsAndDiffs' sesDiffs