[GHC] #13906: ApplicativeDo doesn't handle existentials as well as it could

GHC ghc-devs at haskell.org
Fri Jun 30 21:34:46 UTC 2017


#13906: ApplicativeDo doesn't handle existentials as well as it could
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  ApplicativeDo
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Copied from Phab:D3691:

 simonmar:

 But the proposal in Trac #13906 loses some opportunities for parallelism.
 e.g.

 {{{#!hs
 do
   T x1 <- A
   x2 <- B[x1]
   T x2 <- C
   x4 <- D[x2]
   return (x2,x4)
 }}}

 and we want to get `(A;B) | (C;D)`, not `(A; (B|C); D)`

 ----

 dfeuer:

 We do? I think we don't. Suppose we have

 {{{#!hs
 do
   () <- m
   n
 }}}

 Surely we only want to perform `n` if `m` successfully produces non-bottom
 `()`. The dependency is implicit. To get the parallelism, you need to
 eliminate the strict binding.

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


More information about the ghc-tickets mailing list