[GHC] #9495: Do What I Mean RULES for foldr2 look shady

GHC ghc-devs at haskell.org
Sun Aug 24 03:42:20 UTC 2014


#9495: Do What I Mean RULES for foldr2 look shady
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  highest     |        Milestone:  7.8.4
             Component:              |          Version:  7.8.3
  libraries/base                     |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  Runtime     |  Related Tickets:
  crash                              |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by dfeuer):

 * priority:  normal => highest
 * milestone:   => 7.8.4


Comment:

 I'm elevating the priority because it causes an ''undocumented'' reduction
 in laziness depending on optimization flags. Changing the documentation
 would lower the priority. Note: if eliminating the DWIM non-confluent
 rules is considered too much of a breaking change, we can fix the
 semantics, at least in part, by changing the baseline definition of
 `foldr2`, and making sure the documentation matches. Specifically, make
 the first base case look like

 {{{#!hs
 foldr2 c n [] ys = ys `seq` n
 }}}

 I'm not sure if the rewritten version will end up with the ''same''
 semantics, but I'm pretty sure it won't be ''less'' defined, which is the
 current situation.

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


More information about the ghc-tickets mailing list