[GHC] #13875: ApplicativeDo desugaring is lazier than standard desugaring
GHC
ghc-devs at haskell.org
Tue Aug 8 20:36:46 UTC 2017
#13875: ApplicativeDo desugaring is lazier than standard desugaring
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: simonmar
Type: bug | Status: closed
Priority: high | Milestone: 8.2.1
Component: Compiler | Version: 8.3
Resolution: fixed | Keywords: ApplicativeDo
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3681
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by ElvishJerricco):
Replying to [comment:6 dfeuer]:
> While I'm mentioning idle thoughts: monad comprehension syntax seems to
handle the `pure`/`return`/`pure $`/whatever issue a lot more cleanly than
anything `do`-like. Has anyone considered applicative comprehensions?
This may no longer be the right place to answer this question, but I do
think that using `in` would be better than special casing `return`,
`pure`, and `$`.
{{{
do
a <- foo
b <- bar
in a + b
}}}
Seems more consistent with `let`-binding syntax. Though there is
definitely some value in desugarring those functions since it means
`ApplicativeDo` can be a drop-in optimization.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13875#comment:16>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list