#3416: Make maximumBy strict on the contents of its list
---------------------------------+------------------------------------------
Reporter: bdonlan | Owner:
Type: proposal | Status: reopened
Priority: normal | Milestone:
Component: libraries/base | Version: 6.10.4
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Changes (by bdonlan):
* status: closed => reopened
* type: bug => proposal
* resolution: wontfix =>
* summary: maximumBy uses too much stack => Make maximumBy strict on the
contents of its list
Comment:
Is being able to use maximumBy on a constant comparison function
considered to be the common case here? Is that even _useful_?
It's true that the Haskell Report defines 'maximum' as being non-strict on
its arguments. This is arguably a bug in the Report, however.
Making maximumBy strict on the list elements does indeed change the
behavior of maximumBy, but on most reasonable programs, this should have
no visible effect. It is hard to imagine many cases in which a lazy
version of maximumBy is necessary and desirable, and if it is, it's simple
enough to create one.
Note also that this issue has confused newbies to haskell before:
http://stackoverflow.com/questions/1238883/running-a-compiled-haskell-
program-getting-errors
Why shouldn't we change the behavior of maximumBy (and similar functions
such as minimumBy etc) to be strict on its arguments?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3416#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs