mirror of
https://github.com/github/semantic.git
synced 2024-12-24 07:25:44 +03:00
Don’t unique the lists.
This commit is contained in:
parent
04eb0126e2
commit
5428115895
@ -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 (<=)
|
||||
|
Loading…
Reference in New Issue
Block a user