diff -rN -u old-base/Data/List.hs new-base/Data/List.hs
|
old
|
new
|
|
| 302 | 302 | isInfixOf :: (Eq a) => [a] -> [a] -> Bool |
| 303 | 303 | isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack) |
| 304 | 304 | |
| 305 | | -- | The 'nub' function removes duplicate elements from a list. |
| 306 | | -- In particular, it keeps only the first occurrence of each element. |
| 307 | | -- (The name 'nub' means \`essence\'.) |
| 308 | | -- It is a special case of 'nubBy', which allows the programmer to supply |
| 309 | | -- their own equality test. |
| | 305 | -- | The 'nub' function removes duplicate elements from a |
| | 306 | -- list. In particular, it keeps only the first occurrence |
| | 307 | -- of each element. (The name \"nub\" means \"essence\".) |
| | 308 | -- The 'nub' function is a special case of 'nubBy', which |
| | 309 | -- allows the programmer to supply their own equality test. |
| | 310 | -- |
| | 311 | -- The 'nub' function has time complexity /O(mn)/ on lists |
| | 312 | -- of length /n/ containing /m/ unique elements. 'nubOrd' |
| | 313 | -- is an /O(n log m)/ nub function for 'Ord' data. 'nubInt' |
| | 314 | -- is a faster /O(n log m)/ nub function for 'Int' data. |
| 310 | 315 | nub :: (Eq a) => [a] -> [a] |
| 311 | 316 | #ifdef USE_REPORT_PRELUDE |
| 312 | 317 | nub = nubBy (==) |