#7421: Data.List.insert / insertBy do not match the documentation ----------------------------------------+----------------------------------- Reporter: Bart Massey | Owner: Type: bug | Status: new Priority: normal | Component: libraries/base Version: 7.6.1 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect result at runtime | Blockedby: Blocking: | Related: ----------------------------------------+----------------------------------- In Data.List from base 4.6.0.0 (as in every previous version), the documentation for insert says "The insert function takes an element and a list and inserts the element into the list at the last position where it is still less than or equal to the next element." However:
> insert 1 [2,3,4,2,3,4] [1,2,3,4,2,3,4] One could correct the code to match the documentation. However, any maximally productive version is likely quite a bit less efficient than the current code, and the documented behavior doesn't seem terribly useful. Instead, I suggest patching the documentation in the obvious way: "The insert function takes an element and a list and inserts the element into the list at the first position where it is less than or equal to the next element." -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7421> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs