[GHC] #13153: Several Traversable instances have an extra fmap

GHC ghc-devs at haskell.org
Fri Jan 20 05:20:13 UTC 2017


#13153: Several Traversable instances have an extra fmap
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Core Libraries    |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nomeata):

 The `fmap` in
 {{{
 instance Traversable ZipList where
   traverse f (ZipList xs) = ZipList <$> traverse f xs
 }}}
 is not polymorphic, but rather a concret one (the one from `Functor []`),
 right? I would expect that to be resolved to actual `map`, for which we
 have a `map/coerce` rule, which should optimize the whole `ZipLib <$>`
 stuff away.

 Did you check the core if there is really an `fmap` or `map` left? If so,
 then the rules don't work as expected, and that is a bug.

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


More information about the ghc-tickets mailing list