Opened 8 years ago

Closed 8 years ago

#5473 closed bug (fixed)

sortBy is no longer a good consumer in GHC 7

Reported by: lpsmith Owned by: igloo
Priority: normal Milestone: 7.4.1
Component: Compiler Version: 7.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Documentation bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The List Fusion section of the GHC User's Guide lists sortBy as a good consumer.

In past versions of GHC, sortBy turned its input into a list of lists to be merged by using map (:[]), which is why it was a good consumer. However this is somewhat arguable, as it's only a good consumer in a weak sense of the word. When it comes to doing the real work of the algorithm, sort was never a good consumer.

However, in GHC 7, sortBy breaks its input into monotonic runs, producing a shorter outer list. This is not a good consumer in any sense of the word.

Change History (3)

comment:1 Changed 8 years ago by igloo

Milestone: 7.4.1
Owner: set to igloo

comment:2 Changed 8 years ago by igloo@…

commit 124bad841018d17f36b1d9dd136fb30ce30a2c2d

Author: Ian Lynagh <>
Date:   Sat Nov 26 21:43:42 2011 +0000

    Don't list sortBy as a good consumer; fixes trac #5473

 docs/users_guide/glasgow_exts.xml |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

comment:3 Changed 8 years ago by igloo

Resolution: fixed
Status: newclosed


Note: See TracTickets for help on using tickets.