[GHC] #13593: Unexpected behavior from Data.List.groupBy

GHC ghc-devs at haskell.org
Wed Apr 19 22:13:54 UTC 2017


#13593: Unexpected behavior from Data.List.groupBy
-------------------------------------+-------------------------------------
        Reporter:  dsf               |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dsf):

 To be fair, the documentation says "supply your own equality function",
 and what I'm supplying above is not an equality function.  But a better
 interface might be something like
 {{{#!hs
 groupOn :: Eq b => (a -> b) -> [a] -> [[a]]
 groupOn f xs = groupBy ((==) `on` f) xs
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13593#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list