From 5428115895fa2aac2f7ea838585baabb8712dac2 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 6 Jul 2016 10:26:05 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20unique=20the=20lists.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Data/RandomWalkSimilarity.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Data/RandomWalkSimilarity.hs b/src/Data/RandomWalkSimilarity.hs index fb750d6bc..71e576fbe 100644 --- a/src/Data/RandomWalkSimilarity.hs +++ b/src/Data/RandomWalkSimilarity.hs @@ -48,8 +48,8 @@ rws compare getLabel as bs longestIncreasingSubsequence :: Ord a => [a] -> [a] longestIncreasingSubsequence = longestOrderedSubsequenceBy (<) -longestOrderedSubsequenceBy :: Eq a => (a -> a -> Bool) -> [a] -> [a] -longestOrderedSubsequenceBy isOrd = maximumBy (comparing length) . fmap List.nub . filter (isSortedBy isOrd) . subsequences +longestOrderedSubsequenceBy :: (a -> a -> Bool) -> [a] -> [a] +longestOrderedSubsequenceBy isOrd = maximumBy (comparing length) . filter (isSortedBy isOrd) . subsequences isSorted :: Ord a => [a] -> Bool isSorted = isSortedBy (<=)