
#13242: Panic "StgCmmEnv: variable not found" with ApplicativeDo and ExistentialQuantification -------------------------------------+------------------------------------- Reporter: ljli | Owner: simonmar Type: bug | Status: new Priority: highest | Milestone: 8.0.3 Component: Compiler | Version: 8.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 simonpj): Simon I have realised another problem with `ApplicativeDo`, not covered by our paper. Consider {{{ data A where A :: a -> (a->Int) -> A st :: A -> A -> IO (Int,Int) st p q = do p1 <- pure p A x1 f1 <- pure p1 q1 <- pure q A x2 f2 <- pure q1 pure (f1 x1, f2 x2) }}} We'll try to gather `(x1,f1)` in a pair, and `(x2,f2)`; but that won't work because they each mention an existential type variable. Our desugaring just doesn't work at all for that case. What to do? Another awkward wrinkle: what are the dependencies induced by view patterns? And do we account for them? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13242#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler