[GHC] #9585: Note about semantics of (!!) is not specific enough, if it's correct

GHC ghc-devs at haskell.org
Fri Sep 12 21:14:05 UTC 2014


#9585: Note about semantics of (!!) is not specific enough, if it's correct
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:
                  Type:  bug         |           Status:  closed
              Priority:  normal      |        Milestone:
             Component:              |          Version:  7.9
  libraries/base                     |         Keywords:
            Resolution:  fixed       |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  Documentation bug                  |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by nomeata):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 After staring at the code for a few minutes, I also don’t see a difference
 – both evaluate `n` first, and then go down the list in the obvious
 manner.

 Some archaeology reveals: ceb68b9118fa883e88abfaa532fc78f6640cf17f changed
 the prelude definition, and before the change, `!!` would evaluate the
 list before the number.

 So you are right, the comment is wrong. I just removed it.

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


More information about the ghc-tickets mailing list