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

GHC ghc-devs at haskell.org
Mon Jun 1 20:26:02 UTC 2015


#10457: Revise/remove custom mapM implementation for lists
-------------------------------------+-------------------------------------
        Reporter:  dolio             |                   Owner:
            Type:  task              |                  Status:  new
        Priority:  normal            |               Milestone:  7.10.2
       Component:  libraries/base    |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:  Phab:D924
-------------------------------------+-------------------------------------

Comment (by simonmar):

 @simonpj You could in principle write an `Applicative` or `Monad` instance
 that would distinguish between `mapM` and `traverse`, although it wouldn't
 be a good idea.  But strictly speaking this is therefore a semantic
 change.

 In my case it makes a (huge) difference to performance, because `traverse`
 is parallel for the Haxl monad, where as `mapM` is serial.  There's no
 difference in semantics, provided you don't dig into the monad
 implementation and only use the external interface, and provided some
 other conditions are met.

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


More information about the ghc-tickets mailing list