Opened 4 years ago

Closed 4 years ago

Last modified 2 years ago

#11612 closed bug (fixed)

Bug in ApplicativeDo

Reported by: simonmar Owned by:
Priority: high Milestone: 8.0.1
Component: Compiler Version: 8.0.1-rc2
Keywords: ApplicativeDo Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I discovered a bug in ApplicativeDo. Fix coming shortly. The problem is illustrated by this test case, which I will add to ado001.hs in the testsuite:

test11 :: M ()
test11 = do
  x1 <- a
  let x2 = x1
  x3 <- b
  let x4 = c
      x5 = x4
  return (const () (x1,x2,x3,x4))

Which should give (a | b), but gives (a ; b) in 8.0.1 RC.

Change History (6)

comment:1 Changed 4 years ago by simonmar


comment:2 Changed 4 years ago by Simon Marlow <marlowsd@…>

In 3259bf6/ghc:

Fix a bug in ApplicativeDo (#11612)

In some cases ApplicativeDo would miss some opportunities, due to a
wrong calculation of free variables in RnExpr.segments.

comment:3 Changed 4 years ago by simonmar

Status: newmerge

comment:5 Changed 4 years ago by bgamari

Resolution: fixed
Status: mergeclosed

comment:6 Changed 2 years ago by RyanGlScott

Keywords: ApplicativeDo added
Note: See TracTickets for help on using tickets.