[GHC] #9510: Prelude.!! is not a good consumer

#9510: Prelude.!! is not a good consumer -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.8.3 Keywords: fusion | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Runtime Blocked By: | performance bug Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- I think we can probably do something like this, but I haven't checked the Core yet: {{{#!hs xs !! n | n < 0 = error "Prelude.!!: Negative index" | otherwise = foldr go (error "Prelude.!!: index too large or list empty") xs n where go x _ 0 = x go _ f k = f (k - 1) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9510 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9510: Prelude.!! is not a good consumer -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: | Version: 7.8.3 libraries/base | Keywords: fusion Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Runtime | Related Tickets: performance bug | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dfeuer): Note that, like the new `last`-as-`foldl`, this almost certainly won't be able to unbox the list elements, for the same reason. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9510#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9510: Prelude.!! is not a good consumer -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: ekmett Type: bug | Status: patch Priority: normal | Milestone: Component: Core | Version: 7.8.3 Libraries | Keywords: fusion Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Runtime | Related Tickets: performance bug | Test Case: | Blocking: | Differential Revisions: Phab:D380 | -------------------------------------+------------------------------------- Changes (by dfeuer): * cc: core-libraries-committee@… (added) * status: new => patch * differential: => Phab:D380 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9510#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9510: Prelude.!! is not a good consumer
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: ekmett
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Core | Version: 7.8.3
Libraries | Keywords: fusion
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: Runtime | Related Tickets:
performance bug |
Test Case: |
Blocking: |
Differential Revisions: Phab:D380 |
-------------------------------------+-------------------------------------
Comment (by Herbert Valerio Riedel

#9510: Prelude.!! is not a good consumer -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: ekmett Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: Core | Version: 7.8.3 Libraries | Keywords: fusion Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Runtime | Related Tickets: performance bug | Test Case: | Blocking: | Differential Revisions: Phab:D380 | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: patch => closed * resolution: => fixed * milestone: => 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9510#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC