[GHC] #10457: Revise/remove custom mapM implementation for lists

GHC ghc-devs at haskell.org
Thu May 28 00:04:22 UTC 2015


#10457: Revise/remove custom mapM implementation for lists
-------------------------------------+-------------------------------------
              Reporter:  dolio       |             Owner:
                  Type:  task        |            Status:  new
              Priority:  normal      |         Milestone:  7.10.2
             Component:              |           Version:  7.10.1
  libraries/base                     |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  None/Unknown
          Architecture:              |        Blocked By:
  Unknown/Multiple                   |   Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Recently, Simon Marlow asked why the list instance for Traversable had a
 custom mapM implementation that used the Monad operations. Having looked a
 bit, I don't think there's any good reason. The only fusion that the
 custom mapM can participate in is due to it being written as foldr, but
 traverse is, as well. So as long as 'mapM = traverse' is able to inline
 appropriately, there should be no difference.

 Further, this can be changed, in principle, for 7.10.2. It doesn't change
 any types, only the implementation.

 mapM = traverse is the class default definition, so this could possibly be
 completed by just removing the custom definition.

 Link to the libraries thread:
 https://mail.haskell.org/pipermail/libraries/2015-May/025708.html

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


More information about the ghc-tickets mailing list