[GHC] #10892: ApplicativeDo should use *> and <*

GHC ghc-devs at haskell.org
Fri Sep 18 08:25:45 UTC 2015


#10892: ApplicativeDo should use *> and <*
-------------------------------------+-------------------------------------
              Reporter:  simonmar    |             Owner:
                  Type:  task        |            Status:  new
              Priority:  normal      |         Milestone:  8.0.1
             Component:  Compiler    |           Version:  7.11
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
             Test Case:              |        Blocked By:
              Blocking:              |   Related Tickets:
Differential Revisions:              |
-------------------------------------+-------------------------------------
 From @ekmett:

 Would it be possible to tweak the generation to use `(<*)` or `(*>)` where
 appropriate when the result isn't being used?

 For many Applicatives this can be a massive asymptotic win in terms of
 sharing and/or computational cost.

 When desugaring using (<*) you'd just omit any handling of the unused
 result instead.

 {{{
 (\x y -> ...) <$> foo <* bar <*> baz
 }}}

 corresponds to

 {{{
 do x <- foo
   bar
   y <- baz
   return ...
 }}}

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


More information about the ghc-tickets mailing list