[GHC] #12490: With RebindableSyntax, ApplicativeDo should eliminate return/pure

GHC ghc-devs at haskell.org
Mon Aug 29 22:57:10 UTC 2016


#12490: With RebindableSyntax, ApplicativeDo should eliminate return/pure
-------------------------------------+-------------------------------------
        Reporter:  AaronFriel        |                Owner:  simonmar
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 For the record, there is actually a TODO in the code describing this exact
 shortcoming. See `isReturnApp` in `RnExpr`
 (https://ghc.haskell.org/trac/ghc/browser/ghc/compiler/rename/RnExpr.hs#L1774)

 I believe that the problem is that the `Applicative` do desugaring happens
 in the renamer, where we are unable to lookup whether `return` should be
 the normal `Control.Monad.return` or some rebound alternative. It's not
 clear to me how to best fix this short of moving the `Applicative` do
 implementation to the typechecker, but I'll make sure Simon Marlow knows
 about this when we next meet.

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


More information about the ghc-tickets mailing list