[GHC] #10060: The Traversable instance for Array looks unlikely to be good

#10060: The Traversable instance for Array looks unlikely to be good -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: bug | Status: new Priority: normal | Milestone: Component: Core | Version: 7.11 Libraries | Operating System: Unknown/Multiple Keywords: | Type of failure: Runtime Architecture: | performance bug Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Currently, {{{#!hs instance Ix i => Traversable (Array i) where traverse f arr = listArray (bounds arr) `fmap` traverse f (elems arr) }}} Since `traverse` is (inherently) not a good producer for list fusion, this looks suspicious. I think we almost certainly want to walk the array by hand instead. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10060 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10060: The Traversable instance for Array looks unlikely to be good -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by dfeuer): Er .... actually, the situation is more complex than I thought. Specifically, it sometimes does make sense to do it somewhat like this for something like the `[]` applicative. Ugh. On the other hand, I don't necessarily think traversing an `Array` in `[]` is a terribly sane thing to do. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10060#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10060: The Traversable instance for Array looks unlikely to be good -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: bug | Status: closed Priority: normal | Milestone: Component: Core Libraries | Version: 7.11 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by dfeuer): * status: new => closed * resolution: => invalid Comment: Yeah, this probably just isn't even possible at all. Sorry. There may be some room for improvement, but I'll need to think on it more. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10060#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC