Ticket #2717: base.patch

File base.patch, 1.2 KB (added by Bart Massey, 4 years ago)
  • Data/List.hs

    diff -rN -u old-base/Data/List.hs new-base/Data/List.hs
    old new  
    302302isInfixOf               :: (Eq a) => [a] -> [a] -> Bool 
    303303isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack) 
    304304 
    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. 
    310315nub                     :: (Eq a) => [a] -> [a] 
    311316#ifdef USE_REPORT_PRELUDE 
    312317nub                     =  nubBy (==)