[GHC] #13511: ApplicativeDo incorrectly requiring Monad

GHC ghc-devs at haskell.org
Sun Apr 2 13:13:02 UTC 2017


#13511: ApplicativeDo incorrectly requiring Monad
-------------------------------------+-------------------------------------
        Reporter:  mnislaih          |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:                    |             Keywords:  ApplicativeDo
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 mnislaih):

 The user's guide doesn't explicitly mention let bindings, it only says:
 >In general, the rule for when a do statement incurs a Monad constraint is
 as follows. If the do-expression has the following form:
 {{{
 do p1 <- E1; ...; pn <- En; return E
 }}}
 >where none of the variables defined by p1...pn are mentioned in E1...En,
 then the expression will only require Applicative. Otherwise, the
 expression will require Monad. The block may return a pure expression E
 depending upon the results p1...pn with either return or pure.

 Or were you referring to something else ?

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


More information about the ghc-tickets mailing list